Пример #1
0
            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;
            }
Пример #2
0
            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
                });
            }
Пример #3
0
        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);
        }
Пример #4
0
 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));
 }
Пример #5
0
        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);
        }