/// <summary> /// Initializes a new GitHubIntegrationEntities object using the connection string found in the 'GitHubIntegrationEntities' section of the application configuration file. /// </summary> public GitHubIntegrationEntities() : base() { _connectionString = ConfigurationManager.ConnectionStrings["GitHubIntegrationEntities"]?.ConnectionString; InstanceKey = Guid.NewGuid(); _contextStartup = new ContextStartup(null, true); this.CommandTimeout = _contextStartup.CommandTimeout; this.OnContextCreated(); }
/// <summary> /// Initialize a new GitHubIntegrationEntities object with an audit modifier. /// </summary> public GitHubIntegrationEntities(string connectionString) : base() { _connectionString = connectionString; InstanceKey = Guid.NewGuid(); _contextStartup = new ContextStartup(null, true); this.CommandTimeout = _contextStartup.CommandTimeout; this.OnContextCreated(); }
/// <summary> /// Initialize a new GitHubIntegrationEntities object with an audit modifier. /// </summary> public GitHubIntegrationEntities(IContextStartup contextStartup) : base() { _contextStartup = contextStartup; _tenantId = (this.ContextStartup as TenantContextStartup)?.TenantId; _connectionString = ConfigurationManager.ConnectionStrings["GitHubIntegrationEntities"]?.ConnectionString; InstanceKey = Guid.NewGuid(); this.CommandTimeout = _contextStartup.CommandTimeout; this.OnContextCreated(); }
public ContextBase(IContextStartup startup, string connectionString) : base() { if (startup == null) { throw new Exception("Startup cannot be null"); } _tenantId = (startup as TenantContextStartup)?.TenantId; _connectionString = connectionString; this.ContextStartup = startup; this.OnContextCreated(); }
public ContextBase(IContextStartup startup) : base() { if (startup == null) { throw new Exception("Startup cannot be null"); } _tenantId = (startup as TenantContextStartup)?.TenantId; _connectionString = ConfigurationManager.ConnectionStrings[this.GetType().Name]?.ConnectionString; this.ContextStartup = startup; this.OnContextCreated(); }
public GitHubIntegrationEntities(IContextStartup startup, DbContextOptions options) : base(options) { if (startup == null) { throw new Exceptions.ContextConfigurationException("Startup cannot be null"); } _contextStartup = startup; _tenantId = (this.ContextStartup as TenantContextStartup)?.TenantId; InstanceKey = Guid.NewGuid(); if (_contextStartup.CommandTimeout > 0) { this.CommandTimeout = _contextStartup.CommandTimeout; } this.OnContextCreated(); }