private bool AnnotationsAreCompatible( PrimitivePropertyConfiguration other, ref string errorMessage) { bool flag = true; foreach (KeyValuePair <string, object> annotation1 in (IEnumerable <KeyValuePair <string, object> >) this.Annotations) { if (other.Annotations.ContainsKey(annotation1.Key)) { object objA = annotation1.Value; object annotation2 = other.Annotations[annotation1.Key]; IMergeableAnnotation mergeableAnnotation = objA as IMergeableAnnotation; if (mergeableAnnotation != null) { CompatibilityResult compatibilityResult = mergeableAnnotation.IsCompatibleWith(annotation2); if (!(bool)compatibilityResult) { flag = false; ref string local = ref errorMessage; local = local + Environment.NewLine + "\t" + compatibilityResult.ErrorMessage; } } else if (!object.Equals(objA, annotation2)) { flag = false; ref string local = ref errorMessage; local = local + Environment.NewLine + "\t" + Strings.ConflictingAnnotationValue((object)annotation1.Key, (object)objA.ToString(), (object)annotation2.ToString()); } }
internal virtual void MakeCompatibleWith(PrimitivePropertyConfiguration other, bool inCSpace) { if (object.ReferenceEquals((object)this, (object)other)) { return; } if (inCSpace) { if (other.ConcurrencyMode.HasValue) { this.ConcurrencyMode = new System.Data.Entity.Core.Metadata.Edm.ConcurrencyMode?(); } if (other.DatabaseGeneratedOption.HasValue) { this.DatabaseGeneratedOption = new System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption?(); } if (!other.IsNullable.HasValue) { return; } this.IsNullable = new bool?(); } else { if (other.ColumnName != null) { this.ColumnName = (string)null; } if (other.ParameterName != null) { this.ParameterName = (string)null; } if (other.ColumnOrder.HasValue) { this.ColumnOrder = new int?(); } if (other.ColumnType != null) { this.ColumnType = (string)null; } foreach (string key in (IEnumerable <string>)other._annotations.Keys) { if (this._annotations.ContainsKey(key)) { IMergeableAnnotation annotation = this._annotations[key] as IMergeableAnnotation; if (annotation == null || !(bool)annotation.IsCompatibleWith(other._annotations[key])) { this._annotations.Remove(key); } } } } }