Skip to content

Override default repository through the ServiceCollection #16

@Psypher9

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions