public virtual void ProcessCommand(IEntityGuid entity, CommandTypeOption type) { if (entity == null) { return; } var storeHistoryAttributes = entity.GetType().GetCustomAttributes(typeof(StoreHistoryAttribute), inherit: true); if (!storeHistoryAttributes.HasItems <object>()) { return; } var storeHistoryAttr = (StoreHistoryAttribute)storeHistoryAttributes.First(); string serializedData = null; if (storeHistoryAttr.StoreSnapShot) { serializedData = _serializer.Serialize(entity); } var entityHistory = CreateHistoryRecord(storeHistoryAttr, entity, type, _currentUser, serializedData); ProcessCustomValuesForEntity(entity, entityHistory); _repository.AddOrUpdate(entityHistory); }
public void ProcessCommand(IEntityGuid entity, CommandTypeOption type) { return; }
protected virtual IEntityHistory CreateHistoryRecord(StoreHistoryAttribute attribute, IEntityGuid entity, CommandTypeOption type, IUserId user, string data) { return(new EntityHistory(attribute.EntityTypeId, type, entity.Guid, user.Id, data)); }