Utility.BaseClasses.LiteDB 1.0.1

dotnet add package Utility.BaseClasses.LiteDB --version 1.0.1
                    
NuGet\Install-Package Utility.BaseClasses.LiteDB -Version 1.0.1
                    
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="Utility.BaseClasses.LiteDB" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Utility.BaseClasses.LiteDB" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Utility.BaseClasses.LiteDB" />
                    
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 Utility.BaseClasses.LiteDB --version 1.0.1
                    
#r "nuget: Utility.BaseClasses.LiteDB, 1.0.1"
                    
#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 Utility.BaseClasses.LiteDB@1.0.1
                    
#: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=Utility.BaseClasses.LiteDB&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Utility.BaseClasses.LiteDB&version=1.0.1
                    
Install as a Cake Tool

Utility.BaseClasses.LiteDB


This library extends the Utility.BaseClasses library without including the Utility.BaseClasses library to add a wrapper for LiteDB methods that simplify the process of storing information in LiteDB Collections.

Available Classes

LiteDBFileExtension


Static class that allows you to get and set the file extension used to create LiteDB files.

Public Methods
Set

Set the file extension used by the Utility.BaseClasses.LiteDB library

Get

Returns the file extension to be used by the Utility.BaseClasses.LiteDB library

LiteDBCollection


This public static class allows you to load and save data in a LiteDB file. It uses the LiteDBDocument class to create the LiteDB BSON document that will be stored in the LiteDB file.

Public Methods

SetLiteDBCollectionName

Sets the internal property value for the LiteDBCollectionName.

GetLiteDBCollectionName

Gets the LiteDBCollectionName from the private string.

Save

The overloaded Save method allows you to send in specific types that will be saved to the LiteDB

Load

The overloaded Load method returns specific types of data stored in the LiteDB file without requiring you to cast the object as a specific type. The Load methods also provide a way to return a default value when the value you are trying to retrieve doesn't exist in the LiteDB file.

SaveList

The SaveList method uses List<T> to allow saving a full list into a single field in the LiteDBCollection. Due to a conflict with Save([object]) the SaveList method allows for differentiating saving a List<T> from an object.

LoadList

The LoadList method does not have the same issue as the SaveList method, but to keep things consistent this method was renamed to provide easy reference for which Load and Save to use when storing a list of values. This method also loads the list from a single field so you can store an entire list in LiteDB using the same collection you use for other items.

LiteDBDocument


This is the class that holds the information to be stored in LiteDB.

Properties
Name

The BsonValue property is used to uniquely identify the item in the LiteDB file.

Value

The object property contains the data that is to be stored or retrieved from the LiteDB file.

Public Methods
Initialized

The Initialized method is used to check and make sure all required pieces are set before storing the

SetLiteDBDocumentCollectionName

Sets the private string for the LiteDBDocumentCollectionName.

GetLiteDBDocumentCollectionName

Gets the LiteDBDocumentCollectionName from the private string.

Load

The Load method loads the save content from the LiteDB file.

Save

The Save method checks if the items exists before either creating or updating the item in the LiteDB file.

LiteDBFile


Class that LiteDB file is stored the information for where the file is stored and how to open it.

Properties
LiteDBConnectionString

The LiteDBConnectionString property is a LiteDB.ConnectionString, which is used to simplify the process of connecting to and using a LiteDB file.

Public Method
SetLiteDBFileName

Sets the private property value for the LiteDBPassword.

GetLiteDBFileName

Gets the LiteDBPassword from the private property.

SetLiteDBPassword

Sets the private property value for the LiteDBPassword.

GetLiteDBPassword

Gets the LiteDBPassword from the private property.

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 is compatible.  net452 is compatible.  net46 is compatible.  net461 is compatible.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5

  • .NETFramework 4.5.1

  • .NETFramework 4.5.2

  • .NETFramework 4.6

  • .NETFramework 4.6.1

  • .NETFramework 4.6.2

  • .NETFramework 4.7

  • .NETFramework 4.7.1

  • .NETFramework 4.7.2

  • .NETFramework 4.8

  • .NETFramework 4.8.1

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.1 220 2/22/2024
1.0.0 205 2/22/2024