Exemplo n.º 1
0
        public bool Insert(Class cls, string InstructorLastname)
        {
            var instCtrl = new InstructorsController(Connection);
            var inst     = instCtrl.GetByLastname(InstructorLastname);

            if (inst == null)
            {
                return(false);
            }
            cls.InstructorId = inst.Id;
            return(Insert(cls));
        }
Exemplo n.º 2
0
        public IEnumerable <ClassWithInstructor> GetClassesWithInstructor()
        {
            var instCtrl = new InstructorsController(Connection);
            var classes  = from c in GetAll()
                           join i in instCtrl.GetAll()
                           on c.InstructorId equals i.Id
                           select new ClassWithInstructor {
                Class = c, Instructor = i
            };

            return(classes);
        }