public HttpResponseMessage Push(MFTFormSubmissionDTO mftForm) { if (ModelState.IsValid) { _service.AddMFTForm(mftForm); return Request.CreateResponse(HttpStatusCode.OK, mftForm); } return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); }
public void AddMFTForm(MFTFormSubmissionDTO mftForm) { MFTFormSubmission newForm = Mapper.Map<MFTFormSubmission>(mftForm); _repo.Add<MFTFormSubmission>(newForm); _repo.SaveChanges(); }