public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab) { if (name == null || lab == null) { throw new ArgumentNullException("Error: Either name or lab are null."); } else { ILocalCourse course = new LocalCourse(); course.Name = name; course.Teacher = teacher; course.Lab = lab; return(course); } }
static void Main() { LocalCourse localCourse = new LocalCourse("Databases"); Console.WriteLine(localCourse); localCourse.Lab = "Enterprise"; Console.WriteLine(localCourse); localCourse.Students = new List<string>() { "Peter", "Maria" }; Console.WriteLine(localCourse); localCourse.TeacherName = "Svetlin Nakov"; localCourse.AddStudent("Milena"); localCourse.AddStudent("Todor"); Console.WriteLine(localCourse); OffsiteCourse offsiteCourse = new OffsiteCourse( "PHP and WordPress Development", "Mario Peshev", new List<string>() { "Thomas", "Ani", "Steve" }); Console.WriteLine(offsiteCourse); }
public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab) { var localCourse = new LocalCourse(name, teacher, lab); return localCourse; }
public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab) { ICourse localCourse = new LocalCourse(name, teacher, lab); return((ILocalCourse)localCourse); }
public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab) { if (name == null || lab == null) { throw new ArgumentNullException("Error: Either name or lab are null."); } else { ILocalCourse course = new LocalCourse(); course.Name = name; course.Teacher = teacher; course.Lab = lab; return course; } }
public ILocalCourse CreateLocalCourse(string name, ITeacher teacher, string lab) //TODO maybe return type should be ICourse { ILocalCourse localCourse = new LocalCourse(); return(localCourse); }