internal static bool TryGetScale(this TypeUsage type, out byte scale) { if (type.IsPrimitiveType(PrimitiveTypeKind.Decimal)) { return(type.TryGetFacetValue <byte>("Scale", out scale)); } scale = (byte)0; return(false); }
internal static bool TryGetMaxLength(this TypeUsage type, out int maxLength) { if (type.IsPrimitiveType(PrimitiveTypeKind.String) || type.IsPrimitiveType(PrimitiveTypeKind.Binary)) { return(type.TryGetFacetValue <int>("MaxLength", out maxLength)); } maxLength = 0; return(false); }
internal static bool TryGetPrecision(this TypeUsage type, out byte precision) { if (type.IsPrimitiveType(PrimitiveTypeKind.Decimal)) { return(type.TryGetFacetValue <byte>("Precision", out precision)); } precision = (byte)0; return(false); }
internal static bool TryGetIsUnicode(this TypeUsage type, out bool isUnicode) { if (type.IsPrimitiveType(PrimitiveTypeKind.String)) { return(type.TryGetFacetValue <bool>("Unicode", out isUnicode)); } isUnicode = false; return(false); }