Elmah.OracleErrorLog.GetProviderInfo C# (CSharp) Méthode

GetProviderInfo() private static méthode

private static GetProviderInfo ( DbProviderFactory dbProviderFactory ) : ProviderInfo
dbProviderFactory DbProviderFactory
Résultat ProviderInfo
        private static ProviderInfo GetProviderInfo(DbProviderFactory dbProviderFactory)
        {
            Debug.Assert(dbProviderFactory != null);

            var parameter = dbProviderFactory.CreateParameter();
            if (parameter == null)
                throw new NotSupportedException();

            var specificTypeProperties =
                from property in parameter.GetType().GetProperties()
                let attribute = (DbProviderSpecificTypePropertyAttribute)Attribute.GetCustomAttribute(property, typeof(DbProviderSpecificTypePropertyAttribute), false)
                where attribute != null
                   && attribute.IsProviderSpecificTypeProperty
                select property;

            var specificTypeProperty = specificTypeProperties.Single();
            var specificType = specificTypeProperty.PropertyType;
            var clobDbType = GetEnumValueOfAny(specificType, "NClob");
            var refCursorDbType = GetEnumValueOfAny(specificType, "Cursor", "RefCursor");

            return new ProviderInfo(specificTypeProperty, clobDbType, refCursorDbType);
        }