Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        public IHttpActionResult PostClienteViewModel(ClienteViewModel clienteViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }


            _ClienteAppService.Criar(clienteViewModel);



            return(CreatedAtRoute("DefaultApi", new { id = clienteViewModel.Id }, clienteViewModel));
        }