Exemplo n.º 1
0
 private static void ReleaseSqlServerContext(AdoContext context)
 {
     lock (SqlServerLock)
     {
         SqlServerContexts.Add(context as TestAdoContext);
     }
 }
Exemplo n.º 2
0
 private static void ReleaseOracleContext(AdoContext context)
 {
     lock (OracleLock)
     {
         OracleContexts.Add(context as TestAdoContext);
     }
 }
Exemplo n.º 3
0
 public MainController(MainForm form1)
 {
     _view              = form1;
     _efContext         = new ApplicationDbContext();
     _adoContext        = new AdoContext();
     _dbTableRepository = new DbTableRepository(_adoContext);
     _syncService       = new SyncService(this, _efContext, _dbTableRepository);
 }
Exemplo n.º 4
0
        public MainController(MainDialog view)
        {
            _view       = view;
            _efContext  = new ApplicationDbContext();
            _adoContext = new AdoContext();

            _efContext.Database.Migrate();
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 7
0
        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();
            }
        }
Exemplo n.º 8
0
        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());
        }
Exemplo n.º 9
0
 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>();
 }
Exemplo n.º 10
0
 public FamiliaController()
 {
     db = new AdoContext();
 }
Exemplo n.º 11
0
 public ProjectRepository(AdoContext context)
 {
     _context = context;
 }
Exemplo n.º 12
0
 public MiembroController()
 {
     db = new AdoContext();
 }
Exemplo n.º 13
0
 public SyncTableFacade()
 {
     context           = new ApplicationDbContext();
     adoContext        = new AdoContext();
     dbTableRepository = new DbTableRepository(adoContext);
 }
Exemplo n.º 14
0
 public AdoRepository(AdoContext context, IApiIdentity apiIdentity) : base(context, apiIdentity)
 {
 }
 public static (dynamic, IList ls) Execute <TEntity>(this AdoContext adoContext, TEntity entity)
 {
Exemplo n.º 16
0
 public UnityOfWork(AdoContext adoContext)
 {
     this.adoContext = adoContext;
 }
Exemplo n.º 17
0
 public AdoCargoRepository(AdoContext context)
 {
     _context = context;
 }
Exemplo n.º 18
0
 public AdoUnitOfWork()
 {
     _repositories = new Hashtable();
     _context      = new AdoContext();
 }
Exemplo n.º 19
0
 public StoreRepository(AdoContext context)
 {
     this.context = context;
 }