Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i want to know what is " getters with
non-trivial implementations?" of my property.
Posted
Updated 12-Feb-13 0:55am
v2

1 solution

A trivial implementation would be one where the getter simply returns the value of a private field

C#
private string _fullname;
public string Fullname
{
    get
    {
        return _fullname;
    }
}


A non trivial example might be a getter that does something non - trivial, such as

C#
public decimal TaxAmount
{
    get
    {
         decimal taxRate = GetTaxRate(Income);
         decimal taxable = Income - TaxFreePay(Income);
         return taxable * taxRate;
    }
}


In other words, a non trivial implementation is just what it says - an implementation that is not trivial.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900