static void Main(string[] args) { var hello = "hello"; var sb = new StringBuilder(); sb.Append("<p>"); sb.Append(hello); sb.Append("/<p>"); Console.WriteLine(sb); var words = new[] { "hello", "world" }; sb.Clear(); sb.Append("<ul>"); foreach (var word in words) { sb.AppendFormat("<li>{0}</li>", word); } sb.Append("</ul>"); Console.WriteLine(sb); var builder = new HtmlBuilder("ul"); builder.AddChild("li", "Hello").AddChild("li", "World"); Console.WriteLine(builder); var me = Person.New.Called("Manuel").WorksAs("MyJob").Build(); Console.WriteLine(me); var apb = new AnotherPersonBuilder(); AnotherPerson person = apb.Works.At("Fabrikam").AsA("Eng").Earning(100000).Lives.At("123 London").In("London").WithPostCode("123"); Console.WriteLine(person); }
public AnotherPersonAddressBuilder(AnotherPerson person) { this.person = person; }
public AnotherPersonJobBuilder(AnotherPerson person) { this.person = person; }