Record type with multiple constructors
Use optional arguments.
public record Person(int Id = default, string FirstName = null, string LastName = null);
You can write your code like below:
public record Person
{
public int Id { get; init; }
public string FirstName { get; init; }
public string LastName { get; init; }
//constructor
public Person()
{
//init or do something
}
//overload constructor
public Person(int id, string firstName, string lastName)
{
Id = id;
FirstName = firstName;
LastName = lastName;
}
}