示例#1
0
 /// <summary>
 /// Update single entity
 /// </summary>
 /// <param name="EntityObj"></param>
 public void Update(IEntityRoot EntityObj)
 {
     if (EntityObj != null)
     {
         mUpdatedObjects.Add(EntityObj);
     }
     mCommitted = false;
 }
示例#2
0
 /// <summary>
 /// Add single entity
 /// </summary>
 /// <param name="EntityObj"></param>
 public void Add(IEntityRoot EntityObj)
 {
     if (EntityObj != null)
     {
         mNewObjects.Add(EntityObj);
     }
     mCommitted = false;
 }
 public virtual bool Equals(IEntityRoot other)
 {
     if (object.ReferenceEquals(this, other))
     {
         return(true);
     }
     if ((object)other == null)
     {
         return(false);
     }
     return(base.Equals(other));
 }
示例#4
0
        private void AddEntityToAggregate(IEntityRoot entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            entity.Init(RaiseEvent, Id);
            childEntities.Add(entity.Id, entity);

            //Entity states could already be restored from snapshot, we absolutely need to be 100% sure that the states
            //contained in the EntityStates of AggregateRoot are the very same of those one of the Entities.
            //TODO: Consider introducing the concept of entities in NStore directly
            State.EntityStates[entity.Id] = entity.GetState();
        }
示例#5
0
 public abstract bool Equals([AllowNull] IEntityRoot <Guid> other);