コード例 #1
0
 public void Reset(IDataProviderController provider)
 {
     Builder       = provider.GetExportAttribute().CreateConnectionStringBuilder();
     Configuration = new NamedConnectionElement()
     {
         ControllerType = provider.GetType().AssemblyQualifiedName
     };
 }
        public static T GetProviderFactory <T>(this IDataProviderController <T> controller)
            where T : DbProviderFactory
        {
            var export      = controller.GetExportAttribute();
            var factory     = export.DbProviderFactoryType;
            var providerRow = DbProviderFactories.GetFactoryClasses()
                              .Rows.OfType <DataRow>()
                              .Where(row => row["AssemblyQualifiedName"].ToString().Equals(factory.AssemblyQualifiedName))
                              .First();

            return(DbProviderFactories.GetFactory(providerRow) as T);
        }