EFIngresProvider/EFIngresProviderServices.cs
/// <summary>
/// Chooses the appropriate IngresType for the given string type.
/// </summary>
Chooses the appropriate IngresType for the given string type.
Chooses the appropriate IngresType for the given string type .
private static IngresType GetStringDbType(TypeUsage type)
        {
            Debug.Assert(type.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType &&
                PrimitiveTypeKind.String == ((PrimitiveType)type.EdmType).PrimitiveTypeKind, "only valid for string type");
            IngresType dbType;
            if (type.EdmType.Name.ToLowerInvariant() == "xml")
            {
                dbType = IngresType.LongVarChar;
            }
            else
            {
                bool unicode;
                bool fixedLength;
                if (!MetadataHelpers.TryGetIsFixedLength(type, out fixedLength))
                {
                    fixedLength = false;
                }
                if (!MetadataHelpers.TryGetIsUnicode(type, out unicode))
                {
                    unicode = true;
                }
                if (fixedLength)
                {
                    dbType = (unicode ? IngresType.NChar : IngresType.Char);
                }
                else
                {
                    dbType = (unicode ? IngresType.NVarChar : IngresType.VarChar);
                }
            }
            return dbType;
        }
private static IngresType GetStringDbType ( TypeUsage type ) { Debug . Assert ( type . EdmType . BuiltInTypeKind == BuiltInTypeKind . PrimitiveType && PrimitiveTypeKind . String == ( ( PrimitiveType ) type . EdmType ) . PrimitiveTypeKind , " " ) ; IngresType dbType ; if ( type . EdmType . Name . ToLowerInvariant ( ) == " " ) { dbType = IngresType . LongVarChar ; } else { bool unicode ; bool fixedLength ; if ( ! MetadataHelpers . TryGetIsFixedLength ( type , out fixedLength ) ) { fixedLength = false ; } if ( ! MetadataHelpers . TryGetIsUnicode ( type , out unicode ) ) { unicode = true ; } if ( fixedLength ) { dbType = ( unicode ? IngresType . NChar : IngresType . Char ) ; } else { dbType = ( unicode ? IngresType . NVarChar : IngresType . VarChar ) ; } } return dbType ; }
Chooses the appropriate IngresType for the given string type.
Chooses the appropriate IngresType for the given string type .
// Specific type depends on whether the string is a unicode string and whether it is a fixed length string. // By default, assume widest type (unicode) and most common type (variable length)
type
TypeUsage