static void Main() { Carpenter carpenter = new Carpenter(); var table = carpenter.CreateTable(new WoodenTableBuilder()); Console.WriteLine(table.Legs + " " + table.Top); table = carpenter.CreateTable(new IronTableBuilder()); Console.WriteLine(table.Legs + " " + table.Top); Console.ReadKey(); }
static void Main() { Carpenter carpenter = new Carpenter(); var table = carpenter.CreateTable().WithLegsMaterial("wooden").WithTopMaterial("glass").Build(); Console.WriteLine($"table with {table.Legs} legs and {table.Top} top"); Console.ReadKey(); }