Editorial / Best Answer
netdev
To the user of an object, property and public member may not make much difference with respect to syntax. However, property provides the ability to combine both field and method via the get and set accessors.
MS Help for C# presents the best answer for using properties:
Properties have many uses: they can validate data before allowing a change; they can transparently expose data on a class where that data is actually retrieved from some other source, such as a database; they can take an action when data is changed, such as raising an event, or changing the value of other fields.
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_csref/html/f7f67b05-0983-4cdb-96af-1855d24c967c.htm
Public Members
Profile Answers by prasad.kshirsagar Questions by prasad.kshirsagar
Questions by prasad.kshirsagar
Editorial / Best Answer
netdevProfile Answers by netdev Questions by netdev
To the user of an object, property and public member may not make much difference with respect to syntax. However, property provides the ability to combine both field and method via the get and set accessors.
MS Help for C# presents the best answer for using properties:
Properties have many uses: they can validate data before allowing a change; they can transparently expose data on a class where that data is actually retrieved from some other source, such as a database; they can take an action when data is changed, such as raising an event, or changing the value of other fields.
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_csref/html/f7f67b05-0983-4cdb-96af-1855d24c967c.htm
Related Answered Questions
Related Open Questions