Esempio n. 1
0
 public Task <IActionResult> DeleteAsync(
     [FromServices] IDeleteCarCommand command,
     int carId,
     CancellationToken cancellationToken)
 {
     return(command.ExecuteAsync(carId, cancellationToken));
 }
Esempio n. 2
0
 public CarsController(IAddCarCommand addCar, IEditCarCommand editCar, IDeleteCarCommand deleteCar, IGetCarCommand getCar, IGetCarsCommand getCars, LoggedUser user)
 {
     _addCar    = addCar;
     _editCar   = editCar;
     _deleteCar = deleteCar;
     _getCar    = getCar;
     _getCars   = getCars;
     _user      = user;
 }
Esempio n. 3
0
 public CarsController(IGetCarsCommand getCarsCommand, IGetCarCommand getCarCommand, IDeleteCarCommand deleteCarCommand, IGetCategoriesCommand getCategoriesCommand, IGetFuelsCommand getFuelsCommand, IGetBrandsCommand getBrandsCommand, IGetTypesCommand getTypesCommand, IGetModelsCommand getModelsCommand)
 {
     _getCarsCommand       = getCarsCommand;
     _getCarCommand        = getCarCommand;
     _deleteCarCommand     = deleteCarCommand;
     _getCategoriesCommand = getCategoriesCommand;
     _getFuelsCommand      = getFuelsCommand;
     _getBrandsCommand     = getBrandsCommand;
     _getTypesCommand      = getTypesCommand;
     _getModelsCommand     = getModelsCommand;
 }
 public IActionResult Delete(
     [FromServices] IDeleteCarCommand command,
     int id) => command.Execute(id);