Пример #1
0
        IDataProvider IDataProviderFactory.GetDataProvider(IEnumerable <NamedValue> attributes)
        {
            var version      = attributes.FirstOrDefault(_ => _.Name == "version")?.Value;
            var assemblyName = attributes.FirstOrDefault(_ => _.Name == "assemblyName")?.Value;

            var dialect = OracleVersion.v12;

            if (version?.Contains("11") == true)
            {
                dialect = OracleVersion.v11;
            }

            var provider = OracleProvider.Managed;

            if (assemblyName == OracleProviderAdapter.DevartAssemblyName)
            {
                provider = OracleProvider.Devart;
            }
            else if (assemblyName == OracleProviderAdapter.NativeAssemblyName)
            {
                provider = OracleProvider.Native;
            }

            return(OracleTools.GetDataProvider(dialect, provider));
        }
Пример #2
0
        public OracleDataProvider(string name)
            : base(name, null)
        {
            //SqlProviderFlags.IsCountSubQuerySupported    = false;
            SqlProviderFlags.IsIdentityParameterRequired = true;

            SqlProviderFlags.MaxInListValuesCount = 1000;

            SetCharField("Char", (r, i) => r.GetString(i).TrimEnd());
            SetCharField("NChar", (r, i) => r.GetString(i).TrimEnd());

//			ReaderExpressions[new ReaderInfo { FieldType = typeof(decimal), ToType = typeof(TimeSpan) }] =
//				(Expression<Func<IDataReader,int,TimeSpan>>)((rd,n) => new TimeSpan((long)rd.GetDecimal(n)));

            _sqlOptimizer = new OracleSqlOptimizer(SqlProviderFlags);

            SetField <IDataReader, decimal>((r, i) => OracleTools.DataReaderGetDecimal(r, i));
        }
Пример #3
0
        IDataProvider IDataProviderFactory.GetDataProvider(IEnumerable <NamedValue> attributes)
        {
            var assemblyName = attributes.FirstOrDefault(_ => _.Name == "assemblyName");

            return(OracleTools.GetDataProvider(null, assemblyName?.Value));
        }