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(); }
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(); }