Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 01, 2012 05:19 AM by demoninside9
Participant
1204 Points
1708 Posts
Feb 01, 2012 04:41 AM|LINK
Paul Linton public int ID {get; set;}
Thanks Paul for such a piece of information, it takes me closer to what I wanted to know.
one more thing I want to know deeply, it makes any difference for adding property to the field like below 2 methods.
1. int ID {get; set;}
2.int ID get {return _id} set {_id =value;}
how they are differ, as I can see I am using private _id variable in second method.
please explain a bit. it will clear all my doubts.
Thanks
Gaurav
Star
13411 Points
2535 Posts
Feb 01, 2012 04:45 AM|LINK
The feature is called 'automatic properties' if you Google for 'C# automatic properties' you will be drowned in hits.
Feb 01, 2012 05:19 AM|LINK
Thanks Paul
demoninside9
Participant
1204 Points
1708 Posts
Re: It is the right way to do so: Constructor
Feb 01, 2012 04:41 AM|LINK
Thanks Paul for such a piece of information, it takes me closer to what I wanted to know.
one more thing I want to know deeply, it makes any difference for adding property to the field like below 2 methods.
1. int ID {get; set;}
2.int ID get {return _id} set {_id =value;}
how they are differ, as I can see I am using private _id variable in second method.
please explain a bit. it will clear all my doubts.
Thanks
Gaurav
Paul Linton
Star
13411 Points
2535 Posts
Re: It is the right way to do so: Constructor
Feb 01, 2012 04:45 AM|LINK
The feature is called 'automatic properties' if you Google for 'C# automatic properties' you will be drowned in hits.
demoninside9
Participant
1204 Points
1708 Posts
Re: It is the right way to do so: Constructor
Feb 01, 2012 05:19 AM|LINK
Thanks Paul