public async Task <IActionResult> UpdateCurrentLocation([FromBody] ViewModel.UpdateCurrentLocationTripCommand command) { // BadRequest and InternalServerError could be throw in HttpGlobalExceptionFilter, and also by ValidatorActionFilter due to the UpdateTripCommandValidator. var domainCommand = _mapper.Map <UpdateTripCommand>(command); domainCommand.Action = Action.UpdateCurrentLocation; await _dispatcher.SendAsync(domainCommand); return(Ok()); }
public async Task <IActionResult> UpdateCurrentLocation([FromBody] ViewModel.UpdateCurrentLocationTripCommand command) { // TODO: make command immutable // BadRequest and InternalServerError could be throw in HttpGlobalExceptionFilter, and also by ValidatorActionFilter due to the UpdateTripCommandValidator. var domainCommand = _mapper.Map <UpdateTripCommand>(command); domainCommand.Action = Action.UpdateCurrentLocation; domainCommand.Source = Source; domainCommand.UserId = _fakeUser; await _dispatcher.SendAndPublishAsync <UpdateTripCommand, Domain.Trip.Model.Trip>(domainCommand); return(Ok()); }