public Repository(IDBConnectionFactory connectionFactory, ILogger <Repository <T> > logger) { Type TypeT = typeof(T); ctor = TypeT.GetConstructor(Type.EmptyTypes); if (ctor == null) { throw new InvalidOperationException($"Type {TypeT.Name} does not have a default constructor."); } var tableName = TypeT.GetTableName(); if (string.IsNullOrEmpty(tableName)) { throw new InvalidOperationException($"{nameof(TableAttribute)} is missing from type {TypeT.Name}."); } idColumnName = TypeT.GetIdColumnName(); if (string.IsNullOrEmpty(idColumnName)) { throw new InvalidOperationException($"{nameof(IdAttribute)} is missing from type {TypeT.Name}."); } connection = connectionFactory.GetDbConnection(); this.logger = logger; }
/// <summary> /// Construct a <see cref="SetupWizard"/> /// </summary> /// <param name="ioManager">The value of <see cref="ioManager"/></param> /// <param name="console">The value of <see cref="console"/></param> /// <param name="hostingEnvironment">The value of <see cref="hostingEnvironment"/></param> /// <param name="application">The value of <see cref="application"/></param> /// <param name="dbConnectionFactory">The value of <see cref="dbConnectionFactory"/></param> /// <param name="logger">The value of <see cref="logger"/></param> /// <param name="generalConfigurationOptions">The <see cref="IOptions{TOptions}"/> containing the value of <see cref="generalConfiguration"/></param> public SetupWizard(IIOManager ioManager, IConsole console, IHostingEnvironment hostingEnvironment, IApplication application, IDBConnectionFactory dbConnectionFactory, ILogger <SetupWizard> logger, IOptions <GeneralConfiguration> generalConfigurationOptions) { this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager)); this.console = console ?? throw new ArgumentNullException(nameof(console)); this.hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment)); this.application = application ?? throw new ArgumentNullException(nameof(application)); this.dbConnectionFactory = dbConnectionFactory ?? throw new ArgumentNullException(nameof(dbConnectionFactory)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); }
public void RegisterPlugin(string name, IDBConnectionFactory factory) { if (name == null) { throw new ArgumentNullException(nameof(name)); } if (factory == null) { throw new ArgumentNullException(nameof(factory)); } Contract.EndContractBlock(); _cachedPluginNames = null; _pluginRegistry[name] = factory; }
public static Task <IDbConnection> GetAsync(this IDBConnectionFactory factory) { return(factory.GetAsync(DefaultName)); }
public AuthRepository(IDBConnectionFactory connectionFactory, ISendingEmail emailFactory) : base(connectionFactory) { _emailFactory = emailFactory; }
internal DatabaseConnect(IDBConnectionFactory factory) { _connectionFactory = factory; }
public DatabaseConnect() { _connectionFactory = new DBConnectionFactory(); }
public PageRepository(IDBConnectionFactory connectionFactory, ILogger <Repository <PageDTO> > logger) : base(connectionFactory, logger) { }
public CompanyRepository(IDBConnectionFactory connectionFactory) : base(connectionFactory) { }
public BaseRepository(IDBConnectionFactory connectionFactory) { _connectionFactory = connectionFactory; }
public MySqlSnapshotStore(IDBConnectionFactory factory) { this._factory = factory; }
public UserRepository(IDBConnectionFactory connFactory) { _connFactory = connFactory; }
public MySqlEventStore(IDBConnectionFactory factory) { this._factory = factory; }
public ProductRepository(IDBConnectionFactory connectionFactory, ILogger <Repository <ProductDTO> > logger) : base(connectionFactory, logger) { }
public static IDbConnection Get(this IDBConnectionFactory factory) { return(factory.Get(DefaultName)); }
public static IDbConnection Get(this IDBConnectionFactory factory, string name) { return(factory.GetAsync(name).GetAwaiter().GetResult()); }
public UserRepository(IDBConnectionFactory connectionFactory) : base(connectionFactory) { }