public CoreTypeReference(ICoreType <ICoreType> ReferencedType, CoreDataFacets Facets = null, bool ValueRequired = true) { if (Facets != null) { if (Facets.MaxLength != null && not(ReferencedType.CoreType.CanSpecifyLength)) { throw new ArgumentException(); } if (Facets.NumericPrecision != null && not(ReferencedType.CoreType.CanSpecifyPrecision)) { throw new ArgumentException(); } if (Facets.NumericScale != null && not(ReferencedType.CoreType.CanSpecifyScale)) { throw new ArgumentException(); } } this._ReferencedType = ReferencedType; this.Facets = Facets; this.ValueRequired = ValueRequired; this.ClrType = global::ClrType.Get(ReferencedType.CoreType.ClrType).GetReference(); }
/// <summary> /// Determines whether the core type corresponds to a primtive numeric type /// or nullable of same /// </summary> /// <param name="t">The type to examine</param> /// <returns></returns> public static bool IsNumber(this ICoreType t) => t.ClrType.IsNumber();
/// <summary> /// Determines whether the core type corresponds to the <see cref="ulong"/> type /// or nullable of same /// </summary> /// <param name="t">The type to examine</param> /// <returns></returns> public static bool IsUInt64(this ICoreType t) => t.ClrType.IsUInt64();
/// <summary> /// Determines whether the core type corresponds to the <see cref="int"/> type /// or nullable of same /// </summary> /// <param name="t">The type to examine</param> /// <returns></returns> public static bool IsInt32(this ICoreType t) => t.ClrType.IsInt32();
/// <summary> /// Determines whether the core type corresponds to a <see cref="System.Enum"/> type /// or nullable of same /// </summary> /// <param name="t">The type to examine</param> /// <returns></returns> public static bool IsEnum(this ICoreType t) => t.ClrType.IsEnum;
/// <summary> /// Determines whether the core type corresponds to the <see cref="System.Decimal"/> type /// or nullable of same /// </summary> /// <param name="t">The type to examine</param> /// <returns></returns> public static bool IsDecimal(this ICoreType t) => t.ClrType.IsDecimal();
/// <summary> /// Determines whether the core type corresponds to the <see cref="System.DateTime"/> type /// or nullable of same /// </summary> /// <param name="t">The type to examine</param> /// <returns></returns> public static bool IsDateTime(this ICoreType t) => t.ClrType.IsDateTime();