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");
        }
    }


Related Posts

Fatal Error: Peer authentication failed for user "postgres", when trying to get pgsql working with rails.

Problem: Sometimes, we get the following error when trying to make a connection in Rails.  FATAL ERROR: Peer authentication failed for us...