public void Mutate(Student mutable) { Condition.ArgumentNotDefault(mutable, nameof(mutable)); Condition.Require <InvalidOperationException>(StudentId.Equals(mutable.Id)); Condition.Require <ArgumentException>(!ClassId.Equals(default(int))); mutable.Registrations.Single(r => r.ClassId.Equals(ClassId)).Grade = Grade; }
public void Mutate(Student mutable) { Condition.ArgumentNotDefault(mutable, nameof(mutable)); Condition.Require <InvalidOperationException>(StudentId.Equals(mutable.Id)); Condition.Require <ArgumentException>(!ClassId.Equals(default(int))); mutable.Registrations.Add(new StudentToClassRegistration() { ClassId = ClassId, StudentId = StudentId }); }
public IEnumerable <IDiff> DiffWith(AssociationDiffable diffable) { if (!ClassId.Equals(diffable.ClassId)) { yield return(new Diff <string>("", ClassId, diffable.ClassId)); } if (!Type.Equals(diffable.Type)) { yield return(new Diff <string>("", Type, diffable.Type)); } //if (Object.Equals(diffable.Object)) // yield return new Diff<ObjectDiffable>("", Object, diffable.Object); }
public bool Equals(EntityInfo other) { if (Object.ReferenceEquals(other, null)) { return(false); } if (Object.ReferenceEquals(this, other)) { return(true); } return(Extents.Equals(other.Extents) && ClassId.Equals(other.ClassId) && Color.Equals(other.Color) && Layer.Equals(other.Layer) && Linetype.Equals(other.Linetype) && Lineweight.Equals(other.Lineweight)); }
public bool Equals(EntityInfo other) { if (ReferenceEquals(this, other)) { return(true); } if (other is null) { return(false); } var res = Extents.Equals(other.Extents) && ClassId.Equals(other.ClassId) && Color.Equals(other.Color) && Layer.Equals(other.Layer) && Linetype.Equals(other.Linetype) && Lineweight.Equals(other.Lineweight); #if DEBUG if (!res) { } #endif return(res); }