Beispiel #1
0
 public MotoristasController(IMotoristaService motoristaService,
                             IValidator <MotoristaCadastroPostRequest> postValidator,
                             IValidator <MotoristaCadastroPutRequest> putValidator)
 {
     _motoristaService = motoristaService;
     _postValidator    = postValidator;
     _putValidator     = putValidator;
 }
Beispiel #2
0
 public CadastroMotoristaController(IMotoristaService motoristaService,
                                    ICarroService carroService,
                                    IEnderecoService enderecoService,
                                    IValidator <MotoristaCadastroPostRequest> postValidator,
                                    IValidator <MotoristaCadastroPutRequest> putValidator)
 {
     _motoristaService = motoristaService;
     _carroService     = carroService;
     _enderecoService  = enderecoService;
     _postValidator    = postValidator;
     _putValidator     = putValidator;
 }
Beispiel #3
0
        public MotoristaServiceTests()
        {
            _repMotoristaMock   = new Mock <IMotoristaRepository>();
            _repCoordenadasMock = new Mock <ICoordenadasRepository>();

            SetupMocks();

            var services = new ServiceCollection()
                           .AddTransient <IMotoristaService, MotoristaService>(
                x => new MotoristaService(_repMotoristaMock.Object, _repCoordenadasMock.Object));

            var serviceProvider = services.BuildServiceProvider();

            _service = serviceProvider.GetService <IMotoristaService>();
        }
 public IActionResult Remover(
     [FromServices] IMotoristaService service,
     [FromRoute] int cod_Motorista)
 {
     return(Result(service.Remover(cod_Motorista)));
 }
 public IActionResult Atualizar(
     [FromServices] IMotoristaService service,
     [FromBody] AtualizarMotoristaCommand command)
 {
     return(Result(service.Atualizar(command)));
 }
 public IActionResult Criar(
     [FromServices] IMotoristaService service,
     [FromBody] CriarMotoristaCommand command)
 {
     return(Result(service.Criar(command)));
 }
Beispiel #7
0
 public MotoristasController(IMapper mapper, IMotoristaService motoristaService)
 {
     _mapper           = mapper;
     _motoristaService = motoristaService;
 }
 public MotoristaController(IMotoristaService service, ILogger <MotoristaController> logger)
 {
     _service = service;
     _logger  = logger;
 }
 public MotoristaAppService(IUnityOfWorkService uow, IMotoristaService service) : base(uow, service)
 {
 }
Beispiel #10
0
 public MotoristaController(IMotoristaService gerenciadorMotorista)
 {
     MotoristaService = gerenciadorMotorista;
 }