Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

astro-panda/BasicRepos

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BasicRepos

A project to build .NET repository services more quickly

Getting Started

To add Basic Repositories to your service collection simply use AddBasicRepos<TDbContext>() on the Service Collection. For example:

builder.Services.AddBasicRepos<MyDbContext>();

This will add a repository registration for every DbSet<T> on the target DbContext.

To add support for DbSet<T>s in another DbContext, simply call AddBasicRepos<TDbContext>() again with the second type.

For example:

builder.Services.AddBasicRepos<MyDbContext>()
                .AddBasicRepos<MyOtherDbContext>();

Using AddBasicRepos<MyDbContext>() will register each of the following repository types for each DbSet<T>:

  • IRepository<T>: repository with read and write abilities on the underlying data store, with no cache
  • IReadOnlyRepository<T>: repository with only the ability to read from the underlying data store
  • ICachedRepository<T>: repository which wraps an in-memory cache of the items it manages

About

A project to build .NET repository services more quickly

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 5

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.