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
<PackageReference Include="Utility.BaseClasses.LiteDB" Version="1.0.1" />
<PackageVersion Include="Utility.BaseClasses.LiteDB" Version="1.0.1" />
<PackageReference Include="Utility.BaseClasses.LiteDB" />
paket add Utility.BaseClasses.LiteDB --version 1.0.1
#r "nuget: Utility.BaseClasses.LiteDB, 1.0.1"
#:package Utility.BaseClasses.LiteDB@1.0.1
#addin nuget:?package=Utility.BaseClasses.LiteDB&version=1.0.1
#tool nuget:?package=Utility.BaseClasses.LiteDB&version=1.0.1
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 | Versions 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. |
-
.NETFramework 4.5
- LiteDB (>= 5.0.13)
-
.NETFramework 4.5.1
- LiteDB (>= 5.0.13)
-
.NETFramework 4.5.2
- LiteDB (>= 5.0.13)
-
.NETFramework 4.6
- LiteDB (>= 5.0.13)
-
.NETFramework 4.6.1
- LiteDB (>= 5.0.13)
-
.NETFramework 4.6.2
- LiteDB (>= 5.0.13)
-
.NETFramework 4.7
- LiteDB (>= 5.0.13)
-
.NETFramework 4.7.1
- LiteDB (>= 5.0.13)
-
.NETFramework 4.7.2
- LiteDB (>= 5.0.13)
-
.NETFramework 4.8
- LiteDB (>= 5.0.13)
-
.NETFramework 4.8.1
- LiteDB (>= 5.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.