Create and Build
public class Person
{
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public DateTime DateOfBirth { get; set; }
public Pet[] Pets { get; set; } = Array.Empty<Pet>();
}
public class Pet { ... }
public class Car
{
public void AssignOwner(Person person) => Owner = owner;
public Person Owner { get; }
}Create
CreateBuild
BuildOmitAutoProperties
OmitAutoPropertiesWithAutoProperties
WithAutoPropertiesWith
WithNo value specified
With a specified value
With a factory method
Without
WithoutFromFactory
FromFactoryDo
DoLast updated
Was this helpful?