private static XmlReader GetProviderManifest()
 {
     if (EFOracleVersionUtils.GetStorageVersion(EFOracleProviderServices.versionHint_static) >= EFOracleVersion.Oracle12cR1)
     {
         return(EFOracleProviderManifest.GetXmlResource("Oracle.ManagedDataAccess.EntityFramework.Resources.EFOracleProviderManifest_12c_or_later.xml"));
     }
     return(EFOracleProviderManifest.GetXmlResource("Oracle.ManagedDataAccess.EntityFramework.Resources.EFOracleProviderManifest.xml"));
 }
        public EFOracleProviderManifest(string manifestToken)
            : base(EFOracleProviderManifest.GetProviderManifest())
        {
            if (EFProviderSettings.s_tracingEnabled)
            {
                EFProviderSettings.Instance.Trace(EFProviderSettings.EFTraceLevel.Entry, " (ENTRY) EFOracleProviderManifest::EFOracleProviderManifest()\n");
            }
            this._version = EFOracleVersionUtils.GetStorageVersion(manifestToken);
            this._token   = manifestToken;
            ODTSettings.FireEdmInUseEvent();
            EFOracleProviderManifest.m_bMapNumberToBoolean = false;
            int maxPrecision1;

            if ((maxPrecision1 = EFProviderSettings.Instance.GetMaxPrecision("BOOL", true)) > 0)
            {
                EFOracleProviderManifest.m_edmMappingMaxBOOL   = maxPrecision1;
                EFOracleProviderManifest.m_bMapNumberToBoolean = true;
            }
            else
            {
                EFOracleProviderManifest.m_edmMappingMaxBOOL = 1;
            }
            EFOracleProviderManifest.m_bMapNumberToByte = false;
            int maxPrecision2;

            if ((maxPrecision2 = EFProviderSettings.Instance.GetMaxPrecision("BYTE", true)) > 0)
            {
                EFOracleProviderManifest.m_edmMappingMaxBYTE = maxPrecision2;
                EFOracleProviderManifest.m_bMapNumberToByte  = true;
            }
            else
            {
                EFOracleProviderManifest.m_edmMappingMaxBYTE = 3;
            }
            int maxPrecision3;

            EFOracleProviderManifest.m_edmMappingMaxINT16 = (maxPrecision3 = EFProviderSettings.Instance.GetMaxPrecision("INT16", true)) <= 0 ? 5 : maxPrecision3;
            int maxPrecision4;

            EFOracleProviderManifest.m_edmMappingMaxINT32 = (maxPrecision4 = EFProviderSettings.Instance.GetMaxPrecision("INT32", true)) <= 0 ? 10 : maxPrecision4;
            int maxPrecision5;

            EFOracleProviderManifest.m_edmMappingMaxINT64 = (maxPrecision5 = EFProviderSettings.Instance.GetMaxPrecision("INT64", true)) <= 0 ? 19 : maxPrecision5;
            if (!EFProviderSettings.s_tracingEnabled)
            {
                return;
            }
            EFProviderSettings.Instance.Trace(EFProviderSettings.EFTraceLevel.Entry, " (EXIT)  EFOracleProviderManifest::EFOracleProviderManifest()\n");
        }
        private void AppendType(EdmProperty column, string providerManifestToken)
        {
            TypeUsage typeUsage = column.TypeUsage;
            bool      flag      = false;
            Facet     facet;

            if (typeUsage.EdmType.Name == "binary" && 8 == typeUsage.GetMaxLength() && (column.TypeUsage.Facets.TryGetValue("StoreGeneratedPattern", false, out facet) && facet.Value != null) && StoreGeneratedPattern.Computed == (StoreGeneratedPattern)facet.Value)
            {
                flag = true;
                this.AppendIdentifier("rowversion");
            }
            else
            {
                string name = typeUsage.EdmType.Name;
                if (name.ToLowerInvariant() == "guid")
                {
                    this.AppendSql("raw(16)");
                }
                else if (name.ToLowerInvariant() == "pl/sql boolean")
                {
                    this.AppendSql("number(1, 0)");
                }
                else
                {
                    this.AppendSql(name);
                }
                switch (typeUsage.EdmType.Name)
                {
                case "number":
                    this.AppendSqlInvariantFormat("({0}, {1})", (object)typeUsage.GetPrecision(), (object)typeUsage.GetScale());
                    break;

                case "float":
                    this.AppendSqlInvariantFormat("({0})", (object)typeUsage.GetPrecision());
                    break;

                case "char":
                case "nchar":
                case "varchar2":
                case "nvarchar2":
                case "raw":
                    this.AppendSqlInvariantFormat("({0})", (object)typeUsage.GetMaxLength());
                    break;
                }
            }
            if (!flag && column.TypeUsage.Facets.TryGetValue("StoreGeneratedPattern", false, out facet) && facet.Value != null)
            {
                switch ((StoreGeneratedPattern)facet.Value)
                {
                case StoreGeneratedPattern.Identity:
                    if (EFOracleVersionUtils.GetStorageVersion(providerManifestToken) >= EFOracleVersion.Oracle12cR1)
                    {
                        this.AppendSql(" generated by default as identity");
                        break;
                    }
                    EFOracleDdlBuilder.m_bCreateSequenceAndTrigger = true;
                    break;

                case StoreGeneratedPattern.Computed:
                    EFOracleDdlBuilder.m_bCreateSequenceAndTrigger      = true;
                    EFOracleDdlBuilder.m_bStoreGeneratedPatternComputed = true;
                    break;
                }
            }
            this.AppendSql(column.Nullable ? " null" : " not null");
        }