Ejemplo n.º 1
0
 public Task <IActionResult> GetAsync(
     [FromServices] IGetCarCommand command,
     int carId,
     CancellationToken cancellationToken)
 {
     return(command.ExecuteAsync(carId, cancellationToken));
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo n.º 4
0
 public Task <IActionResult> Get(
     [FromServices] IGetCarCommand command,
     int carId,
     CancellationToken cancellationToken) => command.ExecuteAsync(carId);
 public IActionResult Get(
     [FromServices] IGetCarCommand command,
     int id) => command.Execute(id);