Auto-Implemented Properties c#
- by user311130
Hi all,
could someone explain me what's the idea behind using Auto-Implemented Properties c#?
public class Customer
{
public int ID { get; set; }
public string Name { get; set; }
}
I get the motivation to use properties for private field, so we can determine how one can access a private field. But here - it's just like defining the field to be public from the first place. no?
Is there a difference between defining a field to be "public const" or define it to have a get-only property ?
Thanks
Elad