I know that in F# if you have a C# class of the format:
public class Person {
public DateTime BirthDate { get; set; }
public string Name { get; set; }
}
You can initialize it like so, which is nice:
let p = new Person (Name = "John", BirthDate = DateTime.Now)
However how would you initialize it in F# if the C# class also had a constructor like this:
public class Person {
public Person(int id)
{
Id = id
}
public int Id {get; private set;}
public DateTime BirthDate { get; set; }
public string Name { get; set; }
}
Are we forced to use this structure instead?
let p = new Person (123)
p.Name <- "John"
p.BirthDate <- DateTime.Now