public ActionResult Cadastrar(UsuarioDto model) { var user = _serviceUsuario.Cadastrar(Request.Cookies[FormsAuthentication.FormsCookieName].Value, model); if (user) { return(RedirectToAction("Index")); } return(View(model)); }
public IHttpActionResult Cadastrar(UsuarioDto usuarioDto) { try { serviceUsuario.Cadastrar(usuarioDto); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }