Repository navigation
Improvements to DynamicTypeLookupService and subclasses #131
Copy link
Copy link
Open
Labels
Area: MappingRelates to one of the `ITopicMappingService` interfaces or implementations.Relates to one of the `ITopicMappingService` interfaces or implementations.Priority: 3Severity 1: MinorStatus 2: ScheduledPlanned for an upcoming release.Planned for an upcoming release.Type: ImprovementImproves the functionality or interface of an existing feature.Improves the functionality or interface of an existing feature.
Milestone
Description
The system's automatic scanner for custom view models only looks at assemblies the application has already "touched", so a consumer's view-model assembly may be invisible until something else happens to load it first. Today that's worked around with a fragile one-line hack that force-loads a known type. This closes that gap by asking .NET's dependency model for the full list of referenced assemblies, and retires the hack. This also fixes a couple of potential bugs and tidy's up some of the documentation.
Tasks
- Prevent a single unloadable type crashing the entire lookup (
DynamicTypeLookupService) - Document the class precedence, where consumer types override built-in OnTopic types (
DynamicTypeLookupService) - Document the existing class-name limitation, when two assemblies have the same class name (
StaticTypeLookupService,TypeCollection) - Add an constructor overload that accepts an assembly list to the
DynamicTypeLookupServiceand its subclasses-
DynamicTopicLookupService -
DynamicTopicViewModelLookupService -
DynamicTopicBindingModelLookupService
-
- Add an
AssemblyDiscoveryhelper (new class inOnTopic.AspNetCore.Mvc) that unions loaded assemblies with the host's dependencies viaDependencyContext - Retire the
_ = new PageTopicViewModel()force-load hack, in favor ofAssemblyDiscovery(SampleActivator,OnTopic.AspNetCore.Mvc.Host)- Document that this degrades back to today's behavior under single-file, trimmed, AOT published package (unexpected for web apps)
- Add an integration test confirming
AssemblyDiscovery.GetReferencedAssemblies()returns a superset of the loaded-assemblies list without throwing an exception - Apply the same pattern to the OnTopic Editor's
EditorViewModelLookupService,AttributeBindingModelBinder - Create unit tests to validate the above logic
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area: MappingRelates to one of the `ITopicMappingService` interfaces or implementations.Relates to one of the `ITopicMappingService` interfaces or implementations.Priority: 3Severity 1: MinorStatus 2: ScheduledPlanned for an upcoming release.Planned for an upcoming release.Type: ImprovementImproves the functionality or interface of an existing feature.Improves the functionality or interface of an existing feature.
Activity