Example #1
0
        public async override Task <VehicleCategoryView> Execute(UpdateVehicleCategoryCommand command, User?user)
        {
            VehicleCategory cat = await service.GetById(command.Id);

            if (!cat.IsOwner(user !))
            {
                throw new AuthorizationException();
            }

            await service.Update(
                cat,
                new VehicleCategoryUpdate(
                    command.Name,
                    command.Description
                    )
                );

            throw new NotImplementedException();
            // return mapper.Map<VehicleCategory, VehicleCategoryView>(cat);
        }
Example #2
0
 public async Task <ActionResult <VehicleCategoryForReturnDto> > Update(VehicleCategoryForCreationDto updateDto)
 {
     return(await vehicleCategoryService.Update(updateDto));
 }