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 EntityHistory(int entityTypeId, CommandTypeOption commandType, Guid entityGuid, int userId, string data) { TypeId = entityTypeId; CommandTypeId = (int)commandType; EntityGuid = entityGuid; Event = new CommandDate(userId); if (!string.IsNullOrWhiteSpace(data)) { Data = new EntityHistoryData(this, data); } }
public void Add(CommandTypeOption type, string data) { var cmd = new CommandInfo(type, data); this.Add(cmd); }
public EntityHistory(int entityTypeId, CommandTypeOption commandType, Guid entityGuid, int userId) : this(entityTypeId, commandType, entityGuid, userId, null) { }
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)); }
public CommandInfo(CommandTypeOption type, string data) { this.CommandType = type; this.Data = data; }
public CommandInfo(CommandTypeOption type, string data) { CommandType = type; Data = data; }