Re: property inference

Tech-Archive recommends: Fix windows errors by optimizing your registry



rodchar wrote:
hey all,

given:

class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public override string ToString()
{
return this.FirstName + " " + this.LastName;
}
}

question:
so, if you do this type of inference there's no access to the private
variable? is that correct?

What inference? What private variable? The code you posted has neither.


thanks,
rodchar


.



Relevant Pages

  • Re: property inference
    ... public string FirstName ... public override string ToString() ... if you do this type of inference there's no access to the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: property inference
    ... I think inference refered to the private variable.. ... LOL ... public string FirstName ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: property inference
    ... rodchar brought next idea: ... public string FirstName ... if you do this type of inference there's no access to the private variable? ... where the compiler infers that the variable "s" should be of type "String". ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: 2 List collections help
    ... "rodchar" wrote in message ... >> public string FirstName ... >>> i need to iterate thru ListA and for each object in the collection i ... >>> find one of the columns in ListA inside ListB, ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: property inference
    ... sorry for my terminology ignorance. ... "rodchar" wrote: ... public string FirstName ... public override string ToString() ...
    (microsoft.public.dotnet.languages.csharp)