public ActionResult Create([Bind(Include = "Id,Nome,RazaoSocial,CriadoEm,Ativo,Deletado")] ClienteViewModel clienteViewModel) { if (ModelState.IsValid) { clienteViewModel.Id = Guid.NewGuid(); _ClienteAppService.Criar(clienteViewModel); return(RedirectToAction("Index")); } return(View(clienteViewModel)); }
public IHttpActionResult PostClienteViewModel(ClienteViewModel clienteViewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _ClienteAppService.Criar(clienteViewModel); return(CreatedAtRoute("DefaultApi", new { id = clienteViewModel.Id }, clienteViewModel)); }