Home   Wordpress   Log in

Archive for March, 2009

.NET Auto-Property

March 26th, 2009 by admin | 1 Comment | Filed in .NET

How many times in a .NET classes have you written public properties like this?

class Testing
{
    private string m_subject;
    private string m_message;

    public string Subject
    {
        get { return m_subject; }
        set { m_subject = value; }
    }

    public string Message
    {
        get { return m_message; }
        set { m_message = value; }
    }
}
 

.NET has the ability to make that section of code a lot cleaner and easier to read through the use of Auto-Properties.

class Testing
{
    public string Subject { get; set; }
    public string Message { get; set; }
}
 

You can read a little more over at Michael Sync’s blog.

Download Full Movie Online Hytrin