ToolBX.SimpleRepositories 2.2.0

dotnet add package ToolBX.SimpleRepositories --version 2.2.0
NuGet\Install-Package ToolBX.SimpleRepositories -Version 2.2.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="ToolBX.SimpleRepositories" Version="2.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ToolBX.SimpleRepositories --version 2.2.0
#r "nuget: ToolBX.SimpleRepositories, 2.2.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.
// Install ToolBX.SimpleRepositories as a Cake Addin
#addin nuget:?package=ToolBX.SimpleRepositories&version=2.2.0

// Install ToolBX.SimpleRepositories as a Cake Tool
#tool nuget:?package=ToolBX.SimpleRepositories&version=2.2.0

SimpleRepositories

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.2.0 152 1/13/2024
2.2.0-beta1 85 1/7/2024
2.1.1 184 6/19/2023
2.0.2 147 5/2/2023
2.0.1 223 4/27/2023
2.0.0 358 11/12/2022
2.0.0-beta1 129 10/5/2022
1.0.1 485 10/5/2022
1.0.1-beta2 143 7/20/2022
1.0.1-beta1 116 7/19/2022
1.0.0 529 7/1/2022