Exemplo n.º 1
0
        private void SetInsertAudit <T>(T item, DbEntity dbEntity, Guid actedBy) where T : class, IDbEntity, IDbModel, new()
        {
            if (dbEntity.IsNewSequentialPrimaryKey && item.GetPrimaryKey() == Guid.Empty)
            {
                item.SetPrimaryKey(Guid.NewGuid());
            }

            item.HashValue   = HashValueHelper.Generate <T>(item);
            item.CreatedBy   = actedBy;
            item.CreatedDate = DateTimeHelper.Now();
        }
Exemplo n.º 2
0
 private void SetUpdateAudit <T>(T item, Guid actedBy) where T : class, IDbEntity, IDbModel, new()
 {
     item.HashValue   = HashValueHelper.Generate <T>(item);
     item.UpdatedBy   = actedBy;
     item.UpdatedDate = DateTimeHelper.Now();
 }