Exemple #1
0
        public object EditarRestaurante(CadastrarEditarRestauranteRequestViewModel model)
        {
            try
            {
                _restauranteApplication.EditarRestaurante(model);

                return(new ExecutionResult(StatusCodes.Status200OK, "Registro Alterado com sucesso"));
            }
            catch (ArgumentException exception)
            {
                this.HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest;
                return(new ExecutionResult(StatusCodes.Status400BadRequest, exception.Message));
            }
            catch (Exception exception)
            {
                this.HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest;
                return(new ExecutionResult(StatusCodes.Status500InternalServerError, exception.Message));
            }
        }
 public bool EditarRestaurante(CadastrarEditarRestauranteRequestViewModel model)
 {
     return(_restauranteService.EditarRestaurante(Mapper.Map <CadastrarEditarRestauranteRequestViewModel, Restaurante>(model)));
 }