Feb 2, 2015

what is named parameters in c#

Visual Studio 2010 and above give us a facility to specify an argument  for a particular parameter by associating the arguments with the parameter's name rather than with the parameter's position in the parameter list.
For example:
    public class Employee
    {
        public Employee()
        { }
        public void emp(string fName, string lName, decimal salary)
        {
        // here your code
           
        }
        public void Main(string[] args)
        {
           emp(fName: "dilip", lName: "Singh",salary: 10000);
            //OR
           emp(salary: 10000, fName: "dilip", lName: "Singh");
        }
    }