/// <summary> /// Update single entity /// </summary> /// <param name="EntityObj"></param> public void Update(IEntityRoot EntityObj) { if (EntityObj != null) { mUpdatedObjects.Add(EntityObj); } mCommitted = false; }
/// <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)); }
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(); }
public abstract bool Equals([AllowNull] IEntityRoot <Guid> other);