public HttpResponseMessage Create(HttpRequestMessage req, CountyViewModel countyVm) { return(CreateHttpResponse(req, () => { HttpResponseMessage res = null; if (ModelState.IsValid) { var county = new County(); county.UpdateCounty(countyVm); _countyService.Add(county); _countyService.SaveChanges(); var resData = Mapper.Map <County, CountyViewModel>(county); res = req.CreateResponse(HttpStatusCode.OK, resData); } return res; })); }
public ActionResult Add(County County) { return(View(_countyService.Add(County))); }