static void Main(string[] args)
        {
            var    pb     = new PersonBuilder();
            Person person = pb
                            .Lives.At("AlwaysLive")
                            .In("Springfield")
                            .WithPostcode("1542")
                            .Worsks.At("Home")
                            .AsA("Son")
                            .Earning(100);

            WriteLine(person);
            WriteLine("Hello World!");
            ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            var    pb     = new PersonBuilder();
            Person person = pb
                            .Lives
                            .At("123 London Road")
                            .In("almost london")
                            .WithPostcode("SW12BC")
                            .Works
                            .At("globus")
                            .AsA("Engineer")
                            .Earning(123000);

            Console.WriteLine(person);
        }
示例#3
0
        static void Main(string[] args)
        {
            var    pb     = new PersonBuilder();
            Person person = pb
                            .Lives
                            .At("Urb. San Isidro Mzna W Lote 41")
                            .WithPostCode("044")
                            .In("Trujillo")
                            .Works
                            .At("Everis")
                            .AsA("Develop")
                            .Earning(53900);

            Console.WriteLine(person);
        }
        static void Main(string[] args)
        {
            var    pb     = new PersonBuilder();
            Person person = pb
                            .Works
                            .At("Fabrikam")
                            .AsA("Engineer")
                            .Earning(123000)
                            .Lives
                            .At("123 London Road")
                            .In("London")
                            .WithPostCode("SW12AC");

            WriteLine(person);
            ReadKey();
        }
示例#5
0
        static void Main(string[] args)
        {
            var    personBuilder = new PersonBuilder();
            Person person        = personBuilder
                                   .Works
                                   .At("AllState")
                                   .AsA("Consultant")
                                   .Earning(725000)
                                   .Lives
                                   .At("Kharadi")
                                   .City("Pune")
                                   .WithPostalCode("123131");


            Console.WriteLine(person);
        }
        static void Main(string[] args)
        {
            // calls a new Person Builder
            var pb = new PersonBuilder();
            //uses Person instead of var to be able to access the "implicit operator Person: to be able to Consolewriteline"
            Person person = pb
                            // implementing the address builder
                            .Lives
                            .At("123 London Road")
                            .In("London")
                            .WithPostcode("SW12BC")
                            //implementing the job builder
                            .Works
                            .At("Fabrikam")
                            .AsA("Engineer")
                            .Earning(123000);

            WriteLine(person);
        }