Tips and Tricks from my Experience

C# 3.0 – What’s New : {Properties}-Part2

Posted in Uncategorized by Chakravarthy on October 12, 2007

Property of the class can be considered as the mechanism of accessing the private variables of the class. In other words, properties act as wrappers to the private variables. Though, the new feature related to this is not so great from the point of technology, but highly meaningful from the developer point of view. In a large class code, having many fields and exposed as Properties, it is really difficult to remember the private fields association with the respective definition of properties. The new feature of Properties in C# 3.0 language specification says that the developer doesn’t require to define the private variables that are associated with the respective properties. During the good olden days, we are used to the following coding mechanism to declare the property via a private variable.

        // The private Variable declaration
        string strEmpName;

        // Property Declaration
        public string EmployeeName
            get {
                // Returning the value from the private variable
                return strEmpName;
            set {
                // Assigning the value to private Variable
                strEmpName = value; 

But hence forth, by using the C# 3.0 version, we doesn’t require to define as above but just as simple as mentioned below

        public string EmployeeName { get; set; }

How simple is this, by this method we doesn’t require to remember which is property and which is a private variable. But bottom line remains the same as of the old tradition, the only thing that every one has to remember is that, there is no need to declare a private variable and association of the same with the exposed property. Beneath the code, the compiler creates a private variable for each property that you define as such. To justify, use any reflector to understand the emitted IL code and the Assembly signature. You will surprise to note that a separate private variable is associated by the compiler.

Technorati Tags:

39 Responses

Subscribe to comments with RSS.

  1. said, on June 5, 2013 at 1:26 pm

    Growth and adaptation are the keywords for today’s success. Twitter is an online conversation; just think how tedious it would be if someone you were talking to constantly told you about the blog posts they wrote. 7) Backup Power – It’s always a
    good idea to have a backup power supply.

  2. Com.Tw said, on June 5, 2013 at 6:58 pm

    Trying to keep a lid on her temper, after Diana’s insufferable complaints, Portia imagines how she’d like to respond, if only she could.
    All that users have to do is enter the URLs
    of their websites and the keywords they want to check your
    rankings for positions. It is one of most helpful tools to monitor track comments about you
    on the Internet.

  3. Home Insurance said, on June 6, 2013 at 10:31 am

    In case you have a home that is your pride and joy, and you actually want to safeguard it for years to come home Insurance is your best bet.
    In the same manner, as you scout for a home insurance
    policy that will suitable for you, you will also find out that there are actually a lot of options
    as to the different types of policies. You will find it much simpler to file a claim when
    you have all the proof necessary.

  4. what is seo page authority said, on June 6, 2013 at 11:41 am

    Keeping these five rules in mind will help, however a serious look at other aspects
    will help even more in SEO. The increasing sophistication of search engines and the
    methods by which they sort and rank websites means
    that in writing and planning SEO content, an SEO strategist needs to be aware of and cater to the
    capabilities as well as the peculiarities of the most popular search engines.
    Then they’re pocketing the other $13 for themselves.

  5. health insurance said, on June 6, 2013 at 11:51 am

    Knowing the answer to these questions will
    help you recognise which slot you fall into, and what your insurance needs are.
    Anybody can fall victim and thus being well informed on the subject is of uttermost importance.
    Your provider may charge up to 15 percent extra, as well as an administration fee
    if you use a credit card to make your payment.

  6. private health care insurance said, on June 6, 2013 at 6:52 pm

    She has written many articles on Phoenix Medical Insurance and Phoenix Health Insurance Rates.
    If your health changes or if you become pregnant, it
    might be impossible to switch to a plan that covers maternity.
    We also provide an annual wellbeing examine up system in personal hospitals, which
    involves blood checks, height, fat and blood pressure check-up.

  7. health care insurance said, on June 6, 2013 at 8:21 pm

    Everything in your life holds value in monetary terms,
    but some things are invaluable and incomparable
    to anything in life. Unfortunately far too many states are already in financial
    trouble. Divorce does not deny you of this benefit, read on to find out more about this.

  8. said, on June 8, 2013 at 6:12 pm

    – The SEO Wiki – Pedia page, contains some very good information, references and
    in depth detail all about SEO, how it works, how people do it, etc.

    Live Toolbar integrates Live search into Internet Explorer.

    Authorization to post is granted, with the stipulation that
    Master Google, (an SEO rank checker company), and Chimera Exotics are credited as sole source.

  9. Simone said, on June 8, 2013 at 7:16 pm

    We stumbled over here coming from a different website and thought I might check things out.
    I like what I see so i am just following you. Look forward to looking over your
    web page again.

  10. home insurance comparison tool said, on June 8, 2013 at 7:32 pm

    Link exchange is nothing else however it is simply placing
    the other person’s blog link on your page at proper place and other person will also do same in support of you.

  11. day to day car insurance said, on June 12, 2013 at 11:39 am

    This post will assist the internet people for setting up new web site or even a
    weblog from start to end.

  12. said, on June 15, 2013 at 5:02 am

    Hi colleagues, its great paragraph regarding cultureand entirely
    defined, keep it up all the time.

  13. Backlink check said, on June 15, 2013 at 5:52 am

    I love your blog.. very nice colors & theme. Did you make this website yourself
    or did you hire someone to do it for you? Plz reply as I’m looking to design my own blog and would like to find out where u got this from. thank you

  14. cheap car insurance portugal said, on June 15, 2013 at 7:43 am

    I’ve read several excellent stuff here. Definitely price bookmarking for revisiting. I surprise how much effort you put to create this kind of wonderful informative site.

  15. individual health care Insurance said, on June 16, 2013 at 1:03 pm

    hi!,I like your writing very so much! proportion we communicate
    more about your article on AOL? I need a specialist in this space
    to unravel my problem. Maybe that’s you! Looking ahead to look you.

  16. cheap car insurance for the day said, on June 17, 2013 at 12:20 am

    This is my first time visit at here and i am really impressed to read all at one place.

  17. car Insurance by the day online said, on June 17, 2013 at 1:51 am

    My partner and I stumbled over here different web page and thought I might as
    well check things out. I like what I see so now i am following you.

    Look forward to checking out your web page for a second time.

  18. 1 Day Car Insurance Cheap said, on June 17, 2013 at 6:10 am

    I think this is among the most vital information
    for me. And i am glad reading your article. But
    should remark on few general things, The web site style is ideal,
    the articles is really great : D. Good job, cheers

  19. Cheap 2 day Car insurance said, on June 17, 2013 at 9:31 am

    Unquestionably believe that that you said. Your favourite reason seemed to be at the internet the easiest factor to take note
    of. I say to you, I definitely get irked while other folks consider issues that
    they plainly do not recognize about. You controlled to hit the nail upon the top and defined out
    the entire thing with no need side effect , people can take a signal.
    Will likely be back to get more. Thanks

  20. Roland said, on June 22, 2013 at 1:28 am

    Why people still make use of to read news papers when in
    this technological world all is existing on net?

  21. Hi, I check your blog like every week. Your writing style is witty, keep
    up the good work!

  22. Fantastic website. Plenty of helpful information here. I am sending it to some buddies ans additionally sharing in
    delicious. And obviously, thank you on your effort!

  23. cheap car insurance uk for over 50 s said, on August 6, 2013 at 8:13 pm

    I seldom comment, but I looked through a few responses on
    C# 3.0 – What’s New : Properties-Part2 | Tips and Tricks from
    my Experience. I do have a few questions for you if you don’t mind. Could it be only me or do some of the remarks come across like they are left by brain dead folks? 😛 And, if you are posting on additional places, I’d like to
    keep up with you. Could you make a list of the complete urls of all your social community pages like your linkedin profile, Facebook page
    or twitter feed?

  24. emergency 1 day car insurance said, on August 6, 2013 at 8:36 pm

    The majority of insurance companies function very hard to generate policies and defense that meets the actual needs of their customers at a price that they can manage.

    For those who have multiple car inherited, it will
    often lower your premiums when they are all insured under
    the same automobile insurance policy; a place to
    notice when getting quotes for vehicles insurance.
    The anxiety of whether an insurance company will pay for
    basic services, medications, or diagnostic tests is more
    stressful with each passing year.

  25. Gary said, on August 7, 2013 at 1:28 am

    I’ve learn some just right stuff here. Certainly price bookmarking for revisiting. I surprise how much attempt you put to make one of these excellent informative site.

  26. Albertha said, on August 7, 2013 at 3:59 am

    This excellent website certainly has all the information I needed concerning this
    subject and didn’t know who to ask.

  27. total backlink analyzer said, on August 7, 2013 at 4:05 am

    Also mind that reciprocal links have practically no effect on SEO.

    If you want to find forums related to your niche, simply add +keyword after the
    search phrases, making sure to replace “keyword” with whatever keyword you want to
    use. If you prefer to achieve many of the objectives within your business enterprise in just a
    brief time, you need to take advantage of backlink checkers now.

  28. adrian flux one day car insurance said, on August 7, 2013 at 4:45 am

    The auto insurance quotes or other vehicle insurance quotes are usually
    quoted by the companies before considering
    number of factors like, age of the vehicle holder,
    how old is the vehicle, has the vehicle been damaged before also,
    location of the vehicle, is it second hand and other factors.
    It is important to note that the most highly-paid underwriters
    in the insurance field are often the most experienced.
    , but if you’re ever in a jam and want to have your car insured, this is not a bad option to utilize.

  29. said, on August 12, 2013 at 6:40 pm

    We stumbled over here by a different website and thought
    I may as well check things out. I like what I see so i am just following you.
    Look forward to looking at your web page for a second time.

  30. cheapest car insurances uk said, on August 13, 2013 at 5:49 am

    It’s very easy to find out any matter on web as compared to textbooks, as I found this piece of writing at this website.

  31. cheap car Insurance Supermarket said, on August 15, 2013 at 12:35 am

    Though the essential features of auto insurance companies are more almost the same, there would still be some discrepancies and differences.
    Car insurance premium calculator is a striking online feature that allows you to calculate the
    exact premium to be paid by you for your car insurance on the basis
    of the information and details of the make of your car, details of registration of the vehicle, date of insurance
    and the expiration date of the same. Commonly this includes lessons on driving at night, on the
    motorway or in heavily congested areas such as in the
    middle of towns.

  32. said, on August 15, 2013 at 7:32 am

    Good day! This post couldn’t be written any better! Reading this post reminds me of my good old room mate! He always kept chatting about this. I will forward this write-up to him. Fairly certain he will have a good read. Many thanks for sharing!

  33. cheapest car insurance company in uk said, on August 17, 2013 at 11:47 am

    My brother recommended I would possibly like this
    web site. He used to be entirely right. This put up truly made my day.
    You can not consider simply how so much time I had spent for
    this info! Thanks!

  34. I love what you guys are up too. Such clever work and reporting!
    Keep up the very good works guys I’ve added you guys to my own blogroll.

  35. private health insurance rates uk said, on August 23, 2013 at 7:00 pm

    In the Land Down Under, for example, many suddenly started
    to be so immersed with deals for private health insurance in Australia.
    This might include tests and scans, full outpatient cover, full cancer cover, or dental and optical.
    The uninsured, for example, are less likely to seek medical help when first needed.

  36. health insurance quote uk said, on August 30, 2013 at 3:40 pm

    Nowadays, in India there are a wide variety of health insurance companies with a wide variety
    of policies and schemes to choose from according to their needs.

    In a recent speech on the ACA, President Obama said competition among health insurance companies will compete like never before.
    These caps are often in the millions and only in the most extreme circumstance is the lifetime maximum ever reached for Texas health insurance plans.

  37. said, on August 31, 2013 at 12:28 am

    The main thing that you must decide is how long you need the cover for.
    Shopping for cheap car insurance rates online
    is definitely the easiest way to start with. Insurance companies
    assign a different risk rating to each individual make and model.

  38. Kristal said, on August 31, 2013 at 12:37 am

    The southern part of WA is a temperate climate but the sodium problem persists
    for any vehicle housed along the coast. Not all car insurance companies will
    pay for original manufacturer parts to fix your vehicle when it needs repairs.
    Hence, it is important to take all these factors into consideration and opt for a policy
    that will cover the costs of repairs in case your vehicle was
    to meet with an accident of any kind.

  39. home insurance comparison websites uk said, on September 1, 2013 at 2:12 pm

    For example, losses to the home induced by war or earthquakes are
    not usually covered in a homeowner’s insurance policy.

    It’s said that the three most important elements in any real estate decision are:
    location. In general, this is sufficient to meet the needs of most people.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: