Class
Employee
doesn't access the backing field at all -
class Employee
{
public int Empid { get; set; }
public String Empname { get; set; }
public String Emplocation { get; set; }
private int Empsalary;
public int EmpSalary
{
get {return Empsalary; }
set { Empsalary = value;}
}
}
OT: Also it calling the field
Empsalary
is confusing, especially with the lead capital. Personally I'd use
_empSalary
, though many people would suggest
empSalary