private static void Main(string[] args) { if (args is null) { throw new ArgumentNullException(nameof(args)); } var person = new PersonBuilder() .Called("John") .WorksAs("Developer") .WithAge(20) .Build(); Console.WriteLine(person); }
public static PersonBuilder WithAge(this PersonBuilder builder, int age) => builder.Do(p => p.Age = age);
public static PersonBuilder WorksAs(this PersonBuilder builder, string position) => builder.Do(p => p.Position = position);