public async Task <Dictionary <string, string> > Delete(WeatherDeleteCommand command) { try { var data = command.Validate(); if (!data.IsValid) { HandleErrors(command, data); return(command.Notifications); } await Transaction(command, async() => { await _weatherWriteRepository.Delete(command.Id); }); return(command.Notifications); } catch (Exception ex) { command.Notifications.Add("Error", ex.Message); return(command.Notifications); } }
public async Task <IActionResult> Delete([FromBody] WeatherDeleteCommand command) { await _handler.Delete(command); return(Ok(command.Notifications)); }