public void UpdateInstructor(DEV_Library.Models.Instructor instructor) { Entities.Instructor currentInstructor = _context.Instructor.Find(instructor.Id); Entities.Instructor updatedInstructor = Mapper.MapInstructor(instructor); _context.Entry(currentInstructor).CurrentValues.SetValues(updatedInstructor); }
private Entities.Instructor CreateTestInstructor(InstructorViewModel model) { var created = new Entities.Instructor { Email = "*****@*****.**", FirstName = "Tester", LastName = "Account", Phone = "905-123-4567", Id = (instructors.Count + 1).ToString() }; instructors.Add(created); return(created); }
public DEV_Library.Models.Instructor GetInstructorById(Guid id) { Entities.Instructor instructor = _context.Instructor.Find(id); return(Mapper.MapInstructor(instructor)); }
public void AddInstructor(DEV_Library.Models.Instructor instructor) { Entities.Instructor newInstructor = Mapper.MapInstructor(instructor); _context.Add(newInstructor); }