public async Task <HttpResponseMessage> Post(StudentCreateItem studentItem) { var student = Mapper.Map <Student>(studentItem); await this.repository.Save(student); return(this.Request.CreateResponse(HttpStatusCode.OK)); }
public async Task <HttpResponseMessage> Update(StudentCreateItem student) { try { await this.repositoryService.Update(student); } catch { this.ModelState.AddModelError("Exception", "Student update failed. Please contact to your system admin."); return(this.Request.CreateErrorResponse(HttpStatusCode.OK, this.ModelState)); } return(this.Request.CreateResponse(HttpStatusCode.OK)); }
public async Task <HttpResponseMessage> Post(StudentCreateItem student) { await this.repositoryService.Save(student); return(this.Request.CreateResponse(HttpStatusCode.OK)); }
public HttpResponseMessage Post(StudentCreateItem student) { this.studentService.Save(student); return(this.Request.CreateResponse(HttpStatusCode.OK)); }