예제 #1
0
        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));
        }
예제 #2
0
        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));
        }