Exemple #1
0
        public ActionResult Create(SetorViewModel setor)
        {
            if (ModelState.IsValid)
            {
                var setorDomain = Mapper.Map <SetorViewModel, Setor>(setor);
                _setorAppServices.Add(setorDomain);

                return(RedirectToAction("Index"));
            }

            return(View(setor));
        }
Exemple #2
0
 public HttpResponseMessage Post(Setor setor)
 {
     if (setor == null)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
     else
     {
         _setorAppServices.Add(setor);
         return(Request.CreateResponse(HttpStatusCode.OK, setor));
     }
 }