Ejemplo n.º 1
0
 public AirplaneAppService(IAirplaneRepository repository,
                           AirplaneEditarUsecase editarAirplaneUsecase,
                           AirplaneIncluirUsecase incluirAirplaneUsecase,
                           AirplaneExcluirUsecase excluirAirplaneUsecase,
                           IMapper mapper)
     : base(mapper)
 {
     _repository             = repository;
     _editarAirplaneUsecase  = editarAirplaneUsecase;
     _incluirAirplaneUsecase = incluirAirplaneUsecase;
     _excluirAirplaneUsecase = excluirAirplaneUsecase;
 }
Ejemplo n.º 2
0
        public AirplaneAppService ObterAirplaneAppService(KpmgContext context, IMapper mapper)
        {
            var uow = new UnitOfWork(context);
            var airplaneRepository = new AirplaneRepository(context);

            var airplaneValidarCodigoRepetido = new AirplaneValidarCodigoRepetido(airplaneRepository);


            var airplaneValidarEditar =
                new AirplaneValidarEditar(airplaneRepository, airplaneValidarCodigoRepetido);
            var airplaneValidarExcluir = new AirplaneValidarExcluir(airplaneRepository);
            var airplaneValidarIncluir =
                new AirplaneValidarIncluir(airplaneRepository, airplaneValidarCodigoRepetido);
            var airplaneIncluirUsecase = new AirplaneIncluirUsecase(airplaneRepository, airplaneValidarIncluir, uow);
            var airplaneExcluirUsecase = new AirplaneExcluirUsecase(airplaneRepository, airplaneValidarExcluir, uow);
            var airplaneEditarUsecase  = new AirplaneEditarUsecase(airplaneRepository, airplaneValidarEditar, uow);

            return(new AirplaneAppService(airplaneRepository, airplaneEditarUsecase, airplaneIncluirUsecase,
                                          airplaneExcluirUsecase, mapper));
        }