Skip to content

Add ability to use open generics with factory pattern #7

@carusology

Description

@carusology

Based upon my research and the results of this stackoverflow question, it does not appear to be possible to use the factory pattern with Microsoft's built in dependency injection pattern. I need to support something like this:

services.AddWithFactory(
    new Type[] { Foo, Bar },
    typeof(IRepository<>),
    typeof(IRepositoryFactory<>),
    ServiceLifetime.Singleton
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions