Understanding Automatic Properties : Automatic Properties « LINQ « ASP.NET Tutorial






Automatic properties provide you with a shorthand method for defining a new property. 
You can't add any logic to the Getters and Setters for an automatic property. 
You can't create read-only automatic properties.

File: App_Code\AutomaticProperties.cs

public class AutomaticProperties
{
    // Automatic Properties

    public int Id { get; set; }

    public string Description { get; set; }


    // Normal Property

    private decimal _Price;

    public decimal Price
    {
        get { return _Price; }
        set { _Price = value; }
    }
}








17.2.Automatic Properties
17.2.1.Understanding Automatic Properties