public IActionResult CancelarReserva([FromBody] Reserva reserva) { try { ReservaService reservaService = new ReservaService(this._context); reservaService.CancelarReserva(reserva); reservaService.EnviarEmailCancelamento(reserva); return(Ok("")); } catch (Exception ex) { return(BadRequest(new { message = ex.Message })); } }
public async Task <bool> CancelarReserva() { try { if (storage.Count() <= 0) { return(false); } new StorageItemPedido().ExcluirTodos(); await service.CancelarReserva(storage.Consultar()); storage.Excluir(); return(true); } catch (Exception ex) { throw ex; } }