private SQLProviderFactory() { Assembly providerAssembly = Assembly.LoadFrom(BaseConfig.SQLProviderPath); Type sqlProviderType = typeof(ISQLProvider); Type sqlProvider = providerAssembly.GetTypes().FirstOrDefault(t => t != sqlProviderType && sqlProviderType.IsAssignableFrom(t)); if (sqlProvider == null) { throw new EntryPointNotFoundException("Could not find a SQL Provider in the specified assembly"); } _provider = (ISQLProvider)Activator.CreateInstance(sqlProvider); }
public SQLRepository(ISQLProvider provider) { this.connection = provider.GetConnection(); }
public SomeObject(ISQLProvider provider) { _provider = provider; }
public SQLCaller(ISQLProvider sqlProvider) { this.sqlProvider = sqlProvider; }