SimpleAsyncRepository.Abstractions
1.0.0
dotnet add package SimpleAsyncRepository.Abstractions --version 1.0.0
NuGet\Install-Package SimpleAsyncRepository.Abstractions -Version 1.0.0
<PackageReference Include="SimpleAsyncRepository.Abstractions" Version="1.0.0" />
<PackageVersion Include="SimpleAsyncRepository.Abstractions" Version="1.0.0" />
<PackageReference Include="SimpleAsyncRepository.Abstractions" />
paket add SimpleAsyncRepository.Abstractions --version 1.0.0
#r "nuget: SimpleAsyncRepository.Abstractions, 1.0.0"
#:package SimpleAsyncRepository.Abstractions@1.0.0
#addin nuget:?package=SimpleAsyncRepository.Abstractions&version=1.0.0
#tool nuget:?package=SimpleAsyncRepository.Abstractions&version=1.0.0
Simple Async Repository
This is a super simplistic and straight forward implementation of the repository pattern. I found myself doing it over and over again and again for different projects and so I decided to just turn it into a NuGet package.
Getting Started
Installation process
Simply add the desired NuGet package to your project. At the moment there's SimpleAsyncRepository.Abstractions
and SimpleAsyncRepository.InMemory
.
Usage
- Create your model type (i.e.
MyModel
). It must implementSimpleAsyncRepository.Abstractions.IModel
. - Create an interface defining your repository type (i.e.
IMyModelRepository
). It should inherit fromSimpleAsyncRepository.Abstractions.IRepository<T>
. - Create an implementation of your repository by inheriting from the implementation of your choice (i.e.
InMemoryBaseRepository
). Make it also inherit from your interface. - Register your interface and implementation with the DI system of your choice.
MyModel.cs
using SimpleAsyncRepository.Abstractions;
public class MyModel : IModel
{
public Guid Id { get; set; }
public string? Foo { get; set; }
public int Bar { get; set; }
public bool Baz { get; set; }
}
IMyModelRepository.cs
using SimpleAsyncRepository.Abstractions;
public interface IMyModelRepository : IRepository<MyModel> {}
MyModelRepository.cs
using SimpleAsyncRepository.InMemory;
public class MyModelRepository<MyModel> : InMemoryBaseRepository<MyModel>, IMyModelRepository {}
Latest releases
1.0.0 - Initial Release
Contribute
Thank you for your consideration. At the moment I'm not looking for contributions.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SimpleAsyncRepository.Abstractions:
Package | Downloads |
---|---|
SimpleAsyncRepository.InMemory
A simplistic in-memory implementation of the repository pattern. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 215 | 8/25/2024 |