public async override Task Execute(DeleteVehicleCategoryCommand command, User?user) { var cat = await service.GetById(command.Id); if (!cat.IsOwner(user !)) { throw new AuthorizationException(); } await service.Delete(cat); }
public async Task <ActionResult <VehicleCategoryForReturnDto> > Delete(int itemId) { return(await vehicleCategoryService.Delete(itemId)); }