private void SetLastChangeProperties(T entity, DateTime?now = null) { if (entity is ILastChangeTrackable lct) { lct.ModifiedUserId = CurrentUserProvider.GetUserId(); lct.ModifiedDateTime = now ?? DateTime.UtcNow; } }
private void SetCreationProperties(T entity, DateTime?now = null) { if (entity is ICreationTrackable ct) { ct.CreatedUserId = CurrentUserProvider.GetUserId(); ct.CreatedDateTime = now ?? DateTime.UtcNow; } }