public ActionResult Create(SetorViewModel setor) { if (ModelState.IsValid) { var setorDomain = Mapper.Map <SetorViewModel, Setor>(setor); _setorAppServices.Add(setorDomain); return(RedirectToAction("Index")); } return(View(setor)); }
public HttpResponseMessage Post(Setor setor) { if (setor == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } else { _setorAppServices.Add(setor); return(Request.CreateResponse(HttpStatusCode.OK, setor)); } }