public CoreTypeReference CreateReference(CoreDataFacets facets) => new CoreTypeReference ( ReferencedType: this, Facets: facets, ValueRequired: facets.IsValueRequired );
/// <summary> /// Initializes a new <see cref="CoreDataFieldDescription"/> instance /// </summary> /// <param name="Position">The peer-relative position of the field</param> /// <param name="Name">The name of the field</param> /// <param name="DataType">The <see cref="CoreDataType"/> of the field</param> /// <param name="DataFacets">The applicable <see cref="CoreDataFacets"/></param> /// <param name="Documentation">Describes the purposes of the field</param> public CoreDataFieldDescription ( int Position, string Name, CoreDataType DataType, CoreDataFacets DataFacets = null, string Documentation = null ) { this.Position = Position; this.Name = Name; this.DataType = DataType; this.Documentation = Documentation ?? String.Empty; this.DataFacets = DataFacets; }
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(); }