Пример #1
0
        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);
        }
Пример #2
0
 public SQLRepository(ISQLProvider provider)
 {
     this.connection = provider.GetConnection();
 }
Пример #3
0
 public SomeObject(ISQLProvider provider)
 {
     _provider = provider;
 }
 public SQLCaller(ISQLProvider sqlProvider)
 {
     this.sqlProvider = sqlProvider;
 }