LothiumDB 1.2.0

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

// Install LothiumDB as a Cake Tool
#tool nuget:?package=LothiumDB&version=1.2.0

LothiumDB NuGet Version NuGet Downloads

LothiumDB is a simple micro ORM for .Net applications written entirely in C# for fun and offer a lot of different methods to find data in and out of a database. The library has a very simple syntax and give flexibility to the final user if he want to use a query written inside a string variable, or using the SqlBuilder class.

db.query<PocoType>("SELECT * FROM TABLE");

var obj = new PocoObject()
{
    Prop1 = "Prop1",
    Prop2 = "Prop2";  
};
db.Insert<PocoType>(obj);

LothiumDB offers the ability to work with Poco Object to make operations inside the database. The library work well when a Poco Object have inside it all the needed attribute, in fact all the information about the associated table and column will be extracted automatically.

using LothiumDB.Attributes;
namespace TestModels
{
    [Serializable]
    [TableName("TableName")]
    [PrimaryKey("Prop1")]
    public class TabellaDiTest
    {
        [ColumnName("Prop1")] public string? Property1 { get; set; }
        [ColumnName("Prop2")] public string? Property2 { get; set; }
    }
}

Getting started

You can install LothiumDB directly from NuGet using the NuGet Manager inside Visual Studio or with this command:

dotnet add package LothiumDB

The simplest way to set up LothiumDB is using the Database class and the SqlBuilder query constructor.

using LothiumDB;

public class Program
{
    // Instance the configuration object
    var config = new DatabaseConfiguration();
    // Set the provider settings
    config.Provider
        .AddProvider(providerName: "MSSqlServer")
        .AddConnectionString(connectionString);
    // Set the audit settings
    config.Audit
        .AddAudit()
        .SetUser(auditUser: "DatabaseAdmin");
    // Create the new db instance
    var db = config.BuildDatabase(); 
    
    // Execute the first query
    var sql = new SqlBuilder().Select("*").From("TableName"); 
    List<PocoObject> list = db.FetchAll<PocoObject>(sql);
    
    // Execute the second query
    var sql2 = new SqlBuilder().SelectTop(1, "*").From("TableName"); 
    PocoObject pocoObj = db.FetchSingle<PocoObject>(sql);
}

Bug Reports

If you want to contribute to this project, you can send a pull request to the GitHub Repository and i'll be happy to add it to the project. In The feature i'll separate the Master Branch from the Develop Branch

I welcome any type of bug reports and suggestions through my GitHub Issue Tracker.

LothiumDB is copyright © 2023 - Provided under the GNU General Public License v3.0.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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

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.2.0 215 10/15/2023
1.1.3 149 8/28/2023
1.1.2 162 8/24/2023
1.1.1 185 8/11/2023
1.1.0 140 7/23/2023
1.0.0.1 164 7/15/2023

Major fix to methods execution.
Redesing completely the logic of the auto query generations.
Added a new Configuration object for the database creation.