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; }); }
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"); }
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; }
public void SetUp() { obtenerPagoApiService = ServiceBuilder <MercadoLibreOptions> .GetService <PaisesApiService>(); Handler = new ObtenerPaisesHandler(Logger, obtenerPagoApiService, Mapper); request = new ObtenerPaisesRequest(); }
public void SetUp() { service = ServiceBuilder <ChallengeDbContext, UserEntity> .GetService <UserDbService>(); Handler = new InsertarUsuarioHandler(Logger, service, Mapper); user = UserMock.UserModelMock(); }
public void SetUp() { service = ServiceBuilder <MercadoLibreOptions> .GetService <MonedasApiService>(); loggingService = new CsvLoggingService(new OptionsMock <CsvLoggingOptions>(OptionsMockBuilder.GetOptions <CsvLoggingOptions>())); Handler = new ObtenerConversionHandler(Logger, service, loggingService, Mapper); }
public ImportController(CadSysContext _context, IRepo _repo, IExcelConfigurationRepo _excelConfiguration, ServiceBuilder _serviceBuilder) { context = _context; repo = _repo; excelConfiguration = _excelConfiguration; serviceBuilder = _serviceBuilder; dXFRepo = (IFileRepo)serviceBuilder.GetService("DXFRepo"); }
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); }
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; }
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; }
public void SetUp() { obtenerPagoApiService = ServiceBuilder <MercadoLibreOptions> .GetService <BusquedaApiService>(); Handler = new ObtenerItemHandler(Logger, obtenerPagoApiService, Mapper); }
public void SetUp() { service = ServiceBuilder <ChallengeDbContext, CurrencyHistoryEntity> .GetService <CurrencyHistoryDbService>(); entity = CurrencyHistoryMock.CurrencyHistoryEntity(); }
public void SetUp() { service = ServiceBuilder <ChallengeDbContext, UserEntity> .GetService <UserDbService>(); Handler = new EliminarUsuarioHandler(Logger, service, Mapper); }
public void SetUp() { service = ServiceBuilder <MercadoLibreOptions> .GetService <MonedasApiService>(); }
public HomeController(IExcelConfigurationRepo _excelConfig, ServiceBuilder _serviceBuilder) { excelConfig = _excelConfig; dXFRepo = (IFileRepo)_serviceBuilder.GetService("DXFRepo"); }
public void SetUp() { userDbService = ServiceBuilder <ChallengeDbContext, UserEntity> .GetService <UserDbService>(); }