refactor(core): TimeProvider migration Phase 3 — Services, ETL, DateRange#712
Merged
cct08311github merged 1 commit intodotnet10from Mar 21, 2026
Merged
Conversation
…— Services, ETL, DateRange) Replace direct DateTime.Now/UtcNow calls with TimeProvider across 9 files: - Core: DataContext (new TimeProvider property on EmptyContext), WTMLogger (resolve from DI), WtmFileProvider, WtmDataBaseFileHandler - Dashboard: JsonFileDashboardService (constructor-injected TimeProvider) - ETL: EtlQuartzJob (6 occurrences via Wtm.TimeProvider), EtlSchedulerService (resolve from DI) - DateRange: 6 static factory methods with optional TimeProvider? param (backward-compatible — existing static properties delegate to new methods) - FrameworkFilter: clean up Phase 2 fallbacks to use TimeProvider.System Skipped (by design): - AnalysisExcelExporter (static class, display timestamp only) - LoginUserInfo.TimeTick (property initializer, no DI) - DashboardDefinition property initializers (no DI at construction) - EtlPipelineExecutor (progress reporting only) - QuartzHostService (Quartz trigger API) Closes #711 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DateTime.Now/UtcNowtoTimeProvideracross 9 files (Core services, ETL, DateRange, FrameworkFilter cleanup)EmptyContext(DataContext base): newTimeProviderproperty forApplyAuditFields()JsonFileDashboardService: constructor-injectedTimeProviderDateRange: 6 newCreateUtc*()factory methods with optionalTimeProvider?param — existing static properties preserved as backward-compatible wrappers?? DateTime.Now→?? TimeProvider.System)Skipped (by design)
AnalysisExcelExporter— static class, display timestamp onlyLoginUserInfo.TimeTick— property initializer, no DIDashboardDefinitionproperty initializers — no DI at constructionEtlPipelineExecutor— progress reporting onlyQuartzHostService— Quartz trigger API.cshtml,TypeExtension, codegen templates — unchanged from Phase 2Test plan
dotnet build -c Release— 0 new errors (BlazorDemo pre-existing)Closes #711
🤖 Generated with Claude Code