diff --git a/README.md b/README.md index 1642736..2acb097 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # BasicRepos A project to build .NET repository services more quickly + +## Getting Started + +To add Basic Repositories to your service collection simply use `AddBasicRepos()` on the Service Collection. For example: + +```csharp +builder.Services.AddBasicRepos(); +``` + +This will add a repository registration for every `DbSet` on the target `DbContext`. + +> To add support for `DbSet`s in another `DbContext`, simply call `AddBasicRepos()` again with the second type. +> +> For example: +> +> ```csharp +> builder.Services.AddBasicRepos() +> .AddBasicRepos(); +> ``` + +Using `AddBasicRepos()` will register each of the following repository types for each `DbSet`: + +- `IRepository`: repository with read and write abilities on the underlying data store, with no cache +- `IReadOnlyRepository`: repository with only the ability to read from the underlying data store +- `ICachedRepository`: repository which wraps an in-memory cache of the items it manages \ No newline at end of file