private static void ReleaseSqlServerContext(AdoContext context) { lock (SqlServerLock) { SqlServerContexts.Add(context as TestAdoContext); } }
private static void ReleaseOracleContext(AdoContext context) { lock (OracleLock) { OracleContexts.Add(context as TestAdoContext); } }
public MainController(MainForm form1) { _view = form1; _efContext = new ApplicationDbContext(); _adoContext = new AdoContext(); _dbTableRepository = new DbTableRepository(_adoContext); _syncService = new SyncService(this, _efContext, _dbTableRepository); }
public MainController(MainDialog view) { _view = view; _efContext = new ApplicationDbContext(); _adoContext = new AdoContext(); _efContext.Database.Migrate(); }
public MainController(MainForm form1) { _view = form1; _efContext = new ApplicationDbContext(); _adoContext = new AdoContext(); _dbTableRepository = new DbTableRepository(_adoContext); Initialize(); }
public void Setup() { // TODO: Use relative Paths var dbPath = @"C:\Users\Lenovo G50-45\source\repos\WindowsFormsApp4\SyncTests\Db\db.sqlite"; var initialPath = @"C:\Users\Lenovo G50-45\source\repos\WindowsFormsApp4\SyncTests\Db\initial.sqlite"; File.Delete(dbPath); File.Copy(initialPath, dbPath); _context = new AdoContext($"Data Source={dbPath}"); _repo = new ProjectRepository(_context); }
public static void Main(string[] args) { //CreateHostBuilder(args).Build().Run(); var host = CreateHostBuilder(args).Build(); // migrate the database. Best practice = in Main, using service scope using (var scope = host.Services.CreateScope()) { ILogger <Program> logger = null; AdoContext context = null; try { logger = scope.ServiceProvider.GetRequiredService <ILogger <Program> >(); } catch { } try { logger?.LogInformation($"CreateHostBuilder Started {nameof(AdoContext)} "); context = scope.ServiceProvider.GetService <AdoContext>(); // for demo purposes, delete the database & migrate on startup so we can start with a clean slate //context.Database.EnsureDeleted(); logger?.LogInformation("Called EnsureDeleted"); //context?.Database.EnsureCreated(); logger?.LogInformation("Called EnsureCreated"); context?.Database.Migrate(); logger?.LogInformation("Called Migrate"); } catch (Exception ex) { logger?.LogError(ex, $"An error occurred while migrating the database {nameof(AdoContext)}."); try { //context?.Database.EnsureDeleted(); logger?.LogInformation("Called EnsureCreated"); context?.Database.Migrate(); logger?.LogInformation("Called Migrate"); } catch (Exception e) { logger?.LogError(e, "An error occurred while migrating the database."); } } // run the web app host.Run(); } }
public Task <int> Intercept( InterceptorExecutionDelegate next, AdoApiSettings adoApiSettings, WorkspaceSettings workspaceSettings, JiraApiSettings jiraApiSettings) { _adoContext = new AdoContext(adoApiSettings, _cancellationToken); if (!_adoContext.TryConnect()) { _console.Out.WriteLine("Unable to connect to TFS"); return(Task.FromResult(1)); } _jiraContext = new JiraContext(jiraApiSettings, workspaceSettings, _cancellationToken); _migrationRepository = new MigrationRepository(_jiraContext.LocalDirs); _migrationMetaDataService = new MigrationMetaDataService(_jiraContext); return(next()); }
public AdoProjectAccessRepository( IConfiguration configuration, IRepository <AdoProjectAccess> repository, AdoContext context, //IAdoProjectHistoryRepository adoProjectHistoryRepository, IMapper mapper, ILogger <AdoProjectAccessRepository> logger, IMessageBus messageBus, IApiIdentity apiIdentity) : base(context, apiIdentity) { _repository = repository; _context = context; //_adoProjectHistoryRepository = adoProjectHistoryRepository; _mapper = mapper; _logger = logger; _messageBus = messageBus; _userId = ApiIdentity.GetUserName(); _serviceBusConfig = configuration.GetSection(nameof(ServiceBusConfig)).Get <ServiceBusConfig>(); }
public FamiliaController() { db = new AdoContext(); }
public ProjectRepository(AdoContext context) { _context = context; }
public MiembroController() { db = new AdoContext(); }
public SyncTableFacade() { context = new ApplicationDbContext(); adoContext = new AdoContext(); dbTableRepository = new DbTableRepository(adoContext); }
public AdoRepository(AdoContext context, IApiIdentity apiIdentity) : base(context, apiIdentity) { }
public static (dynamic, IList ls) Execute <TEntity>(this AdoContext adoContext, TEntity entity) {
public UnityOfWork(AdoContext adoContext) { this.adoContext = adoContext; }
public AdoCargoRepository(AdoContext context) { _context = context; }
public AdoUnitOfWork() { _repositories = new Hashtable(); _context = new AdoContext(); }
public StoreRepository(AdoContext context) { this.context = context; }