Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            //create a trainee
            Trainee t1 = new Trainee {
                FirstName = "Barath", LastName = "Nallusamy", SpartaNo = 101
            };

            SerializeToFileJSON(t1);

            //Trainee t2 = DeSerializeFromFileJSON("101 - Barath Nallusamy.json");

            //create a course
            Course eng83 = new Course {
                Title = "Engineering 83", Subject = "C# SDET", StartDate = new DateTime(2021, 3, 16)
            };

            eng83.AddTrainee(t1);
            eng83.AddTrainee(new Trainee {
                FirstName = "Martin", LastName = "Beard", SpartaNo = 102
            });
            SerializeToFileJSON(eng83);

            Course otherCourse = DeSerializeCourseFromFileJSON("NewCourse.json");
        }
Ejemplo n.º 2
0
 public void AddTrainee(Trainee newTrainee)
 {
     Trainees.Add(newTrainee);
 }