Click here to Skip to main content
15,903,385 members
Home / Discussions / C#
   

C#

 
GeneralRe: Automatic Properties Pin
Robert Rohde6-Mar-08 1:18
Robert Rohde6-Mar-08 1:18 
GeneralRe: Automatic Properties Pin
GChannon6-Mar-08 1:20
GChannon6-Mar-08 1:20 
GeneralRe: Automatic Properties Pin
Pete O'Hanlon6-Mar-08 1:59
mvePete O'Hanlon6-Mar-08 1:59 
GeneralRe: Automatic Properties Pin
MaxRelaxman6-Mar-08 3:09
MaxRelaxman6-Mar-08 3:09 
GeneralRe: Automatic Properties Pin
Pete O'Hanlon6-Mar-08 4:46
mvePete O'Hanlon6-Mar-08 4:46 
GeneralRe: Automatic Properties Pin
led mike6-Mar-08 4:54
led mike6-Mar-08 4:54 
GeneralRe: Automatic Properties Pin
Robert Rohde6-Mar-08 9:11
Robert Rohde6-Mar-08 9:11 
GeneralAutomatic Properties Pin
GChannon5-Mar-08 22:41
GChannon5-Mar-08 22:41 
Hi,

If you use an automatic property and want to reference it within the same class I assume you would specify the property but if you had another property within the same class that required validation you would reference the field.

Don't you think this is messy code?

<br />
<br />
private string _firstName;<br />
<br />
public string FirstName<br />
    {<br />
<br />
        get<br />
        {<br />
            return _firstName;<br />
        }<br />
        set<br />
        {<br />
            _firstName = value;<br />
        }<br />
    }<br />
<br />
public string LastName  { get; set; }<br />
<br />
public void Foo()<br />
{<br />
 string test = _firstName + LastName;<br />
}<br />
<br />


modified on Thursday, March 6, 2008 5:29 AM

GeneralRe: Automatic Properties Pin
toxcct5-Mar-08 22:45
toxcct5-Mar-08 22:45 
AnswerRe: Automatic Properties Pin
Rajesh R Subramanian5-Mar-08 22:52
professionalRajesh R Subramanian5-Mar-08 22:52 
GeneralRe: Automatic Properties Pin
GChannon5-Mar-08 22:57
GChannon5-Mar-08 22:57 
GeneralRe: Automatic Properties Pin
Vasudevan Deepak Kumar5-Mar-08 23:03
Vasudevan Deepak Kumar5-Mar-08 23:03 
JokeRe: Automatic Properties Pin
Vasudevan Deepak Kumar5-Mar-08 23:00
Vasudevan Deepak Kumar5-Mar-08 23:00 
GeneralRe: Automatic Properties Pin
NormDroid5-Mar-08 23:28
professionalNormDroid5-Mar-08 23:28 
GeneralRe: Automatic Properties Pin
Pete O'Hanlon6-Mar-08 0:53
mvePete O'Hanlon6-Mar-08 0:53 
QuestionHow to retrieve Exchange Server Address Book using C#? Pin
puneet.priyadarshi5-Mar-08 21:59
puneet.priyadarshi5-Mar-08 21:59 
QuestionHexadecimal To Floatin-Point Number Pin
Opa Knack5-Mar-08 21:58
Opa Knack5-Mar-08 21:58 
GeneralRe: Hexadecimal To Floatin-Point Number Pin
Christian Graus5-Mar-08 22:10
protectorChristian Graus5-Mar-08 22:10 
GeneralRe: Hexadecimal To Floatin-Point Number Pin
Opa Knack5-Mar-08 23:37
Opa Knack5-Mar-08 23:37 
GeneralRe: Hexadecimal To Floatin-Point Number Pin
leppie5-Mar-08 23:54
leppie5-Mar-08 23:54 
GeneralRe: Hexadecimal To Floatin-Point Number Pin
kassio5-Mar-08 23:09
kassio5-Mar-08 23:09 
GeneralRe: Hexadecimal To Floatin-Point Number Pin
leppie5-Mar-08 23:55
leppie5-Mar-08 23:55 
QuestionAutomatic refresh.. Pin
Farhath Abbas 5-Mar-08 21:45
Farhath Abbas 5-Mar-08 21:45 
GeneralRe: Automatic refresh.. Pin
Pete O'Hanlon5-Mar-08 21:59
mvePete O'Hanlon5-Mar-08 21:59 
Generala problem about XmlDocument Pin
Nash_exe5-Mar-08 21:45
Nash_exe5-Mar-08 21:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.