public HttpResponseMessage Post(Operador operador) { if (operador == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } else { _operadorAppServices.Add(operador); return(Request.CreateResponse(HttpStatusCode.OK, operador)); } }
public ActionResult Create(OperadorViewModel operador) { if (ModelState.IsValid) { var operadorDomain = Mapper.Map <OperadorViewModel, Operador>(operador); _operadorAppServices.Add(operadorDomain); return(RedirectToAction("Index")); } return(View(operador)); }