Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 /// <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();
Esempio n. 3
0
 /// <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();
Esempio n. 4
0
 /// <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();
Esempio n. 5
0
 /// <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;
Esempio n. 6
0
 /// <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();
Esempio n. 7
0
 /// <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();