Example #1
0
 static Student CreateStudent(StudentBuilder b)
 {
     b.BuildName("he");
     b.BuildAge(16);
     b.BuildAddress("adfasdfa");
     b.BuildPassward("6666666");
     return(b.GetStudent());
 }
Example #2
0
        static void Main(string[] args)
        {
            StudentBuilder builder = new StudentBuilder();
            Student        student = CreateStudent(builder);

            Console.WriteLine(student.Age);
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            Student s = new StudentBuilder(10)
                        .Setname("hassan")
                        .Setfamiy("olfat")
                        .Setage("28")
                        .Setphone("0918")
                        .build();


            Console.WriteLine(s.GetDetails());
            Console.ReadKey();
        }