ToolBX.SimpleRepositories
2.2.0-beta1
See the version list below for details.
dotnet add package ToolBX.SimpleRepositories --version 2.2.0-beta1
NuGet\Install-Package ToolBX.SimpleRepositories -Version 2.2.0-beta1
<PackageReference Include="ToolBX.SimpleRepositories" Version="2.2.0-beta1" />
paket add ToolBX.SimpleRepositories --version 2.2.0-beta1
#r "nuget: ToolBX.SimpleRepositories, 2.2.0-beta1"
// Install ToolBX.SimpleRepositories as a Cake Addin #addin nuget:?package=ToolBX.SimpleRepositories&version=2.2.0-beta1&prerelease // Install ToolBX.SimpleRepositories as a Cake Tool #tool nuget:?package=ToolBX.SimpleRepositories&version=2.2.0-beta1&prerelease
SimpleRepositories
Base classes and interfaces for setting up simple repositories.
Bundles
What the hell is a bundle?
A bundle is basically just a bundle of entities which is typically stored in a serializable file that you can query and/or save to.
It's useful if you need to store data but don't necessarily require a database or if you're just prototyping a quick and dirty idea.
For your information, I use ReadOnlyBundleRepository and BundleRepository to store Rough Trigger's game data such as spritesheet maps (holds sprite positions and sizes,) tilesets or items.
Does it have to be a serialized file?
No. It can be just about anything, really. One of the only contraint for bundles is that entities must have an Id property. This id is automatically incremented whenever a new entity is added to the bundle using ToolBX.Unicity.
Getting started
Check out the unit test project for samples on how to use it.
StartingId
By default, the starting ID for a bundle is 0. If you want to change that, you can do so by overriding the StartingId property in your bundle repository.
public class MyBundleRepository : BundleRepository<MyEntity>
{
protected override int StartingId => 1;
}
With this, your items will be assigned IDs starting at 1 instead of 0.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net7.0
- ToolBX.OutWarden (>= 2.2.0-beta2)
- ToolBX.Unicity (>= 2.2.0-beta1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ToolBX.SimpleRepositories:
Package | Downloads |
---|---|
ToolBX.SimpleRepositories.Bundles
Base classes and interfaces for setting up repositories that query bundles of entities. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 118 | 9/27/2024 |
3.0.0-beta1 | 95 | 9/23/2024 |
2.2.0 | 192 | 1/13/2024 |
2.2.0-beta1 | 135 | 1/7/2024 |
2.1.1 | 222 | 6/19/2023 |
2.0.2 | 176 | 5/2/2023 |
2.0.1 | 259 | 4/27/2023 |
2.0.0 | 401 | 11/12/2022 |
2.0.0-beta1 | 162 | 10/5/2022 |
1.0.1 | 520 | 10/5/2022 |
1.0.1-beta2 | 178 | 7/20/2022 |
1.0.1-beta1 | 145 | 7/19/2022 |
1.0.0 | 566 | 7/1/2022 |