in C# you can do stuff like :
var a = new {name = \"cow\", sound = \"moooo\", omg = \"wtfbbq\"};
and in
As Tony indicated in his answer this is not much better as of F# 4.6. Testing a similar example using .NET Core SDK 3.0.100-preview4-011158 I was able to demonstrate use of the new Anonymous Record feature. As for the RouteMap
method, I'm unfamiliar with what types of values this API accepts but I would suspect that the example below would work.
Ex.
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
{| controller = "Home"; action = "Index"; id = UrlParameter.Optional |} // Parameter defaults
)
Notice the use of the |
character on the insides of the curly braces. This is what now distinguishes regular records from anonymous records in F#.
As for your other example, perhaps the F# example would now look such as below.
let a = {| name = "cow"; sound = "moooo"; omg = "wtfbbq" |}