They are named arguments . They allow you to provide some context to the argument of the function you are passing.
They must be the last .. after all unnamed arguments when calling the function. If there are more than one, they can be transferred in any order .. as long as they arrive after any unnamed ones.
For example: this is not true:
MyFunction(useDefault: true, other, args, here)
This is normal:
MyFunction(other, args, here, useDefault: true)
Where MyFunction can be defined as:
void MyFunction(string other1, string other2, string other3, bool useDefault)
This means that you can also do this:
MyFunction( other1: "Arg 1", other2: "Arg 2", other3: "Arg 3", useDefault: true )
This can be very nice when you need to provide some context, otherwise it is difficult to understand the function call. Take MVC routing, for example, it's hard to say what happens here:
routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
If you look at the definition .. it makes sense:
public static Route MapRoute( this RouteCollection routes, string name, string url, Object defaults )
Whereas with named arguments, it is much easier to understand without looking at the documentation:
routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } );