internal CommonModelProperty(CommonModelProperty mpd) { this.Name = mpd.Name; this.TypeName = mpd.TypeName; this.Nullable = mpd.Nullable; this.MaxLength = mpd.MaxLength; this.Precision = mpd.Precision; this.Scale = mpd.Scale; this.EntityTypes = mpd.EntityTypes; this.TypeDescription = mpd.TypeDescription; }
internal CommonModelProperty(CommonModelProperty mpd) { this.Name = mpd.Name; this.TypeName = mpd.TypeName; this.Nullable = mpd.Nullable; this.MaxLength = mpd.MaxLength; this.Precision = mpd.Precision; this.Scale = mpd.Scale; this.EntityTypes = mpd.EntityTypes; this.TypeDescription = mpd.TypeDescription; }
/// <summary> /// Query for determining what entity types contain all of a set of model properties. /// </summary> /// <param name="memberPropertyDescriptions">An IEnumerable of the model properties that need to be present in all entity types returned by the query.</param> /// <returns>A query (IQueryable) of ModelEntityType objects.</returns> public IQueryable <ModelEntityType> GetTypesWithMembers(IEnumerable <CommonModelProperty> memberPropertyDescriptions) { IQueryable <ModelEntityType> modelEntityTypes = _conceptualModel.EntityTypes.AsQueryable(); foreach (CommonModelProperty memberPropertyDescription in memberPropertyDescriptions) { CommonModelProperty mpd = memberPropertyDescription; modelEntityTypes = modelEntityTypes.Where(et => mpd.EntityTypes.Contains(et)); } modelEntityTypes = modelEntityTypes.OrderBy(et => et.Name); return(modelEntityTypes); }
/// <summary> /// Memberwise equality between this and another instance of this class. /// </summary> /// <param name="obj">Other instance to compare to this object.</param> /// <returns>True if member values are equal, false if not.</returns> public override bool Equals(object obj) { if (obj is CommonModelProperty) { CommonModelProperty mpd = (CommonModelProperty)obj; return(this.Name.Equals(mpd.Name) && this.TypeName.Equals(mpd.TypeName) && this.Nullable.Equals(mpd.Nullable) && this.MaxLength.Equals(mpd.MaxLength) && this.Precision.Equals(mpd.Precision) && this.Scale.Equals(mpd.Scale)); } else { return(false); } }