Mechanism for Dependency Injection to Provide the Most Specific Implementation of a Generic Service Interface
问题 I feel like I played buzzword bingo with the title. Here's a concise example of what I'm asking. Let's say I have some inheritance hierarchy for some entities. class BaseEntity { ... } class ChildAEntity : BaseEntity { ... } class GrandChildAEntity : ChildAEntity { ... } class ChildBEntity : BaseEntity { ... } Now let's say I have a generic interface for a service with a method that uses the base class: interface IEntityService<T> where T : BaseEntity { void DoSomething(BaseEntity entity)...