Skip to content

Override default repository through the ServiceCollection #16

Description

@Psypher9

Premise: Type scanning automatically scans and registers any IRepository and IReadOnlyRepository with the DefaultRepository

  • I can extend the BasicRepos service collection to manually add a specific repository implementation for a given entity type

Example

builder.Services.AddBasicRepos()
                         .AddRepository<MyOverridingRepository>();
  • The AddRepository<TRepository>() extension only accepts types that implements IRepository and/or IReadOnlyRepository and registers a service for each of the implemented interfaces

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions