Skip to content

.NET modernization, second pass #132

Open
Open

Description

@JeremyCaney

After the initial upgrade to a .NET 8 floor with C# 14 (#114, #115), I had done an initial pass of modernizing the code. That covered most everything that was non-breaking. Since we're committed to a major release (6.0), this takes on the bigger items: Dropping the deprecated [obsolete] layer, sealing public classes by default, and adopting TimeProvider for deterministic time-based testing.

Tasks

  • Delete the OnTopic/Obsolete/ folder
  • Inject TimeProvider into the types that stamp time, replacing DateTime.UtcNow and DateTime.Now
    • TopicRepository.Save()
    • TrackedRecord<T>.LastModified
    • Version guards in SqlTopicRepository.Load(), Refresh() and CachedTopicRepository.Load()
  • Seal public concrete classes by default; curate and unseal only the confirmed extension points
    • View Components
    • Controllers
    • Navigation base types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions