Ejemplo n.º 1
0
        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;
            }));
        }
Ejemplo n.º 2
0
 public ActionResult Add(County County)
 {
     return(View(_countyService.Add(County)));
 }