コード例 #1
0
        async Task CycleProprietari(string fileName, MemoryStream stream)
        {
            var judeteAllInclussive = new ConcurrentBag <Judet>(context.Judete.Include(z => z.UATs).ThenInclude(w => w.Localitati));

            var x = await Importer.GetDTOs <OutputProprietarAdresa>(stream, fileName, new ImportConfig(), excelConfiguration);

            IAddressParser addressParser  = (IAddressParser)serviceBuilder.GetService("AddressParser");
            var            addressMatcher = (IMatcher)serviceBuilder.GetService("AddressMatcher");
            var            matchProcessor = (IMatchProcessor)serviceBuilder.GetService("AddressMatchProcessor");

            object locker = new object();

            Parallel.ForEach(x, y =>
            {
                var z = new Proprietar();

                lock (locker)
                {
                    context.Proprietari.Add(z);
                }

                z.FromDTO(y);
                z.Adresa.FromDTO(y, judeteAllInclussive, addressParser, addressMatcher, matchProcessor);
                z.Adresa.Intravilan = true;
            });
        }
コード例 #2
0
 public ProcessController(DropBoxBase _dropBox, CadSysContext _context, IRepo _repo, IExcelConfigurationRepo _excelConfiguration, ServiceBuilder serviceBuilder)
 {
     dropBox            = _dropBox;
     context            = _context;
     repo               = _repo;
     excelConfiguration = _excelConfiguration;
     dxfRepo            = (IFileRepo)serviceBuilder.GetService("DXFRepo");
     excelRepo          = (IFileRepo)serviceBuilder.GetService("ExcelRepo");
 }
コード例 #3
0
ファイル: Exporter.cs プロジェクト: andrei-alex-m/CadSys
        public Exporter(ServiceBuilder serviceBuilder, CadSysContext _context)
        {
            context             = _context;
            comboMatcher        = (IMatcher)serviceBuilder.GetService("CombosIndexMatcher");
            comboMatchProcessor = (IMatchProcessor)serviceBuilder.GetService("CombosIndexMatchProcessor");


            context.Set <UAT>().Load();
            context.Set <Localitate>().Load();
            context.Set <Judet>().Load();


            context.ChangeTracker.AutoDetectChangesEnabled = false;
        }
コード例 #4
0
        public void SetUp()
        {
            obtenerPagoApiService = ServiceBuilder <MercadoLibreOptions> .GetService <PaisesApiService>();

            Handler = new ObtenerPaisesHandler(Logger, obtenerPagoApiService, Mapper);
            request = new ObtenerPaisesRequest();
        }
コード例 #5
0
        public void SetUp()
        {
            service = ServiceBuilder <ChallengeDbContext, UserEntity> .GetService <UserDbService>();

            Handler = new InsertarUsuarioHandler(Logger, service, Mapper);
            user    = UserMock.UserModelMock();
        }
コード例 #6
0
        public void SetUp()
        {
            service = ServiceBuilder <MercadoLibreOptions> .GetService <MonedasApiService>();

            loggingService = new CsvLoggingService(new OptionsMock <CsvLoggingOptions>(OptionsMockBuilder.GetOptions <CsvLoggingOptions>()));
            Handler        = new ObtenerConversionHandler(Logger, service, loggingService, Mapper);
        }
コード例 #7
0
 public ImportController(CadSysContext _context, IRepo _repo, IExcelConfigurationRepo _excelConfiguration, ServiceBuilder _serviceBuilder)
 {
     context            = _context;
     repo               = _repo;
     excelConfiguration = _excelConfiguration;
     serviceBuilder     = _serviceBuilder;
     dXFRepo            = (IFileRepo)serviceBuilder.GetService("DXFRepo");
 }
コード例 #8
0
        public void SetUp()
        {
            monedasApiService = ServiceBuilder <MercadoLibreOptions> .GetService <MonedasApiService>();

            loggingService           = new CsvLoggingService(new OptionsMock <CsvLoggingOptions>(OptionsMockBuilder.GetOptions <CsvLoggingOptions>()));
            currencyHistoryDbService = ServiceBuilder <ChallengeDbContext, CurrencyHistoryEntity> .GetService <CurrencyHistoryDbService>();

            Handler = new ObtenerMonedasHandler(Logger, monedasApiService, loggingService, currencyHistoryDbService, Mapper);
        }
コード例 #9
0
 public ExportController(CadSysContext _context, IExcelConfigurationRepo _excelConfiguration, ServiceBuilder _serviceBuilder, IExporter _cadGenExporter, IHubContext <MessagesHub> _hubContext, DropBoxBase _dropBoxBase)
 {
     context            = _context;
     excelConfiguration = _excelConfiguration;
     dXFRepo            = (IFileRepo)_serviceBuilder.GetService("DXFRepo");
     cadGenExporter     = _cadGenExporter;
     hubContext         = _hubContext;
     dropBoxBase        = _dropBoxBase;
 }
コード例 #10
0
        public void Add(IDefaultModel entity)
        {
            var valid = true;

            if (_repository.GetSingle(entity.Id) != null)
            {
                return;
            }

            var validatorTyper = _typer.GetRefTyper("Validator", TyperAction.Insert);

            if (validatorTyper != null)
            {
                var validator = _serviceBuilder.GetService(validatorTyper);
                valid = (validator as IValidator).Run(entity);
            }

            if (valid)
            {
                _repository.Add(entity);
            }

            return;
        }
コード例 #11
0
        public void SetUp()
        {
            obtenerPagoApiService = ServiceBuilder <MercadoLibreOptions> .GetService <BusquedaApiService>();

            Handler = new ObtenerItemHandler(Logger, obtenerPagoApiService, Mapper);
        }
コード例 #12
0
        public void SetUp()
        {
            service = ServiceBuilder <ChallengeDbContext, CurrencyHistoryEntity> .GetService <CurrencyHistoryDbService>();

            entity = CurrencyHistoryMock.CurrencyHistoryEntity();
        }
コード例 #13
0
        public void SetUp()
        {
            service = ServiceBuilder <ChallengeDbContext, UserEntity> .GetService <UserDbService>();

            Handler = new EliminarUsuarioHandler(Logger, service, Mapper);
        }
コード例 #14
0
 public void SetUp()
 {
     service = ServiceBuilder <MercadoLibreOptions> .GetService <MonedasApiService>();
 }
コード例 #15
0
 public HomeController(IExcelConfigurationRepo _excelConfig, ServiceBuilder _serviceBuilder)
 {
     excelConfig = _excelConfig;
     dXFRepo     = (IFileRepo)_serviceBuilder.GetService("DXFRepo");
 }
コード例 #16
0
 public void SetUp()
 {
     userDbService = ServiceBuilder <ChallengeDbContext, UserEntity> .GetService <UserDbService>();
 }