EFIngresProvider/EFIngresProviderServices.cs
/// <summary>
/// Determines IngresType for the given primitive type. Extracts facet
/// information as well.
/// </summary>
Determines IngresType for the given primitive type. Extracts facet
information as well.
Determines IngresType for the given primitive type . Extracts facet information as well .
private static IngresType GetIngresType(TypeUsage type)
        {
            var primitiveTypeKind = MetadataHelpers.GetPrimitiveTypeKind(type);
            switch (primitiveTypeKind)
            {
                case PrimitiveTypeKind.Binary:
                    return GetBinaryDbType(type);
                case PrimitiveTypeKind.Boolean:
                    return IngresType.Int;
                case PrimitiveTypeKind.Byte:
                    return IngresType.TinyInt;
                case PrimitiveTypeKind.Time:
                    return IngresType.Time;
                case PrimitiveTypeKind.DateTimeOffset:
                    throw new Exception("unknown PrimitiveTypeKind " + primitiveTypeKind);
                case PrimitiveTypeKind.DateTime:
                    return IngresType.DateTime;
                case PrimitiveTypeKind.Decimal:
                    return IngresType.Decimal;
                case PrimitiveTypeKind.Double:
                    return IngresType.Double;
                case PrimitiveTypeKind.Guid:
                    throw new Exception("unknown PrimitiveTypeKind " + primitiveTypeKind);
                case PrimitiveTypeKind.Int16:
                    return IngresType.SmallInt;
                case PrimitiveTypeKind.Int32:
                    return IngresType.Int;
                case PrimitiveTypeKind.Int64:
                    return IngresType.BigInt;
                case PrimitiveTypeKind.SByte:
                    return IngresType.TinyInt;
                case PrimitiveTypeKind.Single:
                    return IngresType.Real;
                case PrimitiveTypeKind.String:
                    return GetStringDbType(type);
                default:
                    Debug.Fail("unknown PrimitiveTypeKind " + primitiveTypeKind);
                    throw new Exception("unknown PrimitiveTypeKind " + primitiveTypeKind);
            }
        }
private static IngresType GetIngresType ( TypeUsage type ) { var primitiveTypeKind = MetadataHelpers . GetPrimitiveTypeKind ( type ) ; switch ( primitiveTypeKind ) { case PrimitiveTypeKind . Binary : return GetBinaryDbType ( type ) ; case PrimitiveTypeKind . Boolean : return IngresType . Int ; case PrimitiveTypeKind . Byte : return IngresType . TinyInt ; case PrimitiveTypeKind . Time : return IngresType . Time ; case PrimitiveTypeKind . DateTimeOffset : throw new Exception ( " " + primitiveTypeKind ) ; case PrimitiveTypeKind . DateTime : return IngresType . DateTime ; case PrimitiveTypeKind . Decimal : return IngresType . Decimal ; case PrimitiveTypeKind . Double : return IngresType . Double ; case PrimitiveTypeKind . Guid : throw new Exception ( " " + primitiveTypeKind ) ; case PrimitiveTypeKind . Int16 : return IngresType . SmallInt ; case PrimitiveTypeKind . Int32 : return IngresType . Int ; case PrimitiveTypeKind . Int64 : return IngresType . BigInt ; case PrimitiveTypeKind . SByte : return IngresType . TinyInt ; case PrimitiveTypeKind . Single : return IngresType . Real ; case PrimitiveTypeKind . String : return GetStringDbType ( type ) ; default : Debug . Fail ( " " + primitiveTypeKind ) ; throw new Exception ( " " + primitiveTypeKind ) ; } }
Determines IngresType for the given primitive type.
Determines IngresType for the given primitive type .
// only supported for primitive type
type
TypeUsage