Pavas.Runtime.MemoryContext
1.0.0
dotnet add package Pavas.Runtime.MemoryContext --version 1.0.0
NuGet\Install-Package Pavas.Runtime.MemoryContext -Version 1.0.0
<PackageReference Include="Pavas.Runtime.MemoryContext" Version="1.0.0" />
paket add Pavas.Runtime.MemoryContext --version 1.0.0
#r "nuget: Pavas.Runtime.MemoryContext, 1.0.0"
// Install Pavas.Runtime.MemoryContext as a Cake Addin #addin nuget:?package=Pavas.Runtime.MemoryContext&version=1.0.0 // Install Pavas.Runtime.MemoryContext as a Cake Tool #tool nuget:?package=Pavas.Runtime.MemoryContext&version=1.0.0
Pavas.Runtime.MemoryContext
Pavas.Runtime.MemoryContext is a library designed to manage in-memory contexts for caching or quick data retrieval operations. This library is particularly useful for applications that require fast access to certain datasets or need to maintain a temporary state in memory.
Features
- In-Memory Data Storage: Provides a simple interface for storing and retrieving data in memory.
- Context Management: Allows the creation of multiple contexts for different datasets.
- Dependency Injection Integration: Easily integrates with ASP.NET Core's dependency injection.
Installation
To use this library, include it in your project through dependency injection.
Usage
Setting Up the Memory Context
Define the memory repositories during the project initialization:
string[] repositories = [ "Name1", "Name2", ...etc ];
or use Repository entity, provides name and default data
```csharp
List<Repository> repositories = [
new Repository("Name1", [])
new Repository("Name2", [])
];
```
Inject the context into the service during the application service configuration:
builder.Services.AddMemoryContext(repositories);
Using the Middleware
The MemoryContextMiddleware
can be used to manage memory contexts throughout the lifecycle of the application:
app.UseMemoryContextMiddleware();
This middleware will ensure that the memory context is properly initialized and disposed of during each request.
Contribution
This project is under continuous development. If you wish to contribute, please fork the repository, create a new branch, and submit a pull request.
License
This project is licensed under the terms of the MIT License.
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. |
-
net8.0
- Pavas.Patterns.Context (>= 1.0.4)
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 | 131 | 8/25/2024 |