public async Task ResignVehicle(ResignVehicleCommand command) { // Get current user id var userId = HttpContextHelper.GetCurrentUserId(); // Set user id command.UserId = userId; var resignVehicleCommandHandler = _serviceProvider.GetRequiredService <ResignVehicleCommandHandler>(); await resignVehicleCommandHandler.Handle(command); }
public async Task <IActionResult> Resign([FromBody] ResignVehicleCommand command) { if (!ModelState.IsValid) { return(BadRequest()); } // Delete vehicle await _vehicleService.ResignVehicle(command); return(Ok()); }