public HttpResponseMessage Create(ClassModel model) { var newClassModel = new DataLayer.DomainModels.ClassModel { ClassName = model.ClassName, Location = model.Location, TeacherName = model.TeacherName }; var classId = _classService.CreateNewClass(newClassModel); return(Request.CreateResponse(HttpStatusCode.OK, classId)); }
public HttpResponseMessage Update(ClassModel model) { var classModel = new DataLayer.DomainModels.ClassModel { ClassId = model.ClassId, ClassName = model.ClassName, TeacherName = model.TeacherName, Location = model.Location }; var success = _classService.UpdateClass(classModel); return(Request.CreateResponse(HttpStatusCode.OK, success)); }