SimpleAsyncRepository.InMemory 1.0.0

dotnet add package SimpleAsyncRepository.InMemory --version 1.0.0
                    
NuGet\Install-Package SimpleAsyncRepository.InMemory -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimpleAsyncRepository.InMemory" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleAsyncRepository.InMemory" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SimpleAsyncRepository.InMemory" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SimpleAsyncRepository.InMemory --version 1.0.0
                    
#r "nuget: SimpleAsyncRepository.InMemory, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SimpleAsyncRepository.InMemory@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SimpleAsyncRepository.InMemory&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SimpleAsyncRepository.InMemory&version=1.0.0
                    
Install as a Cake Tool

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

  1. Create your model type (i.e. MyModel). It must implement SimpleAsyncRepository.Abstractions.IModel.
  2. Create an interface defining your repository type (i.e. IMyModelRepository). It should inherit from SimpleAsyncRepository.Abstractions.IRepository<T>.
  3. Create an implementation of your repository by inheriting from the implementation of your choice (i.e. InMemoryBaseRepository). Make it also inherit from your interface.
  4. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 144 8/25/2024