NarayaniInfotec.DataLite 1.1.1.6

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

DataLite

DataLite is a lightweight, database-agnostic CRUD utility library for .NET. It provides simple Insert, Update, Delete, and Select operations without requiring an ORM or database-specific code.

Designed for:

Web APIs

WinForms / WPF

Console applications

Microservices

Reporting tools

โœจ Key Features

Database-agnostic (via DbProviderFactories)

Parameterized SQL (safe from injection)

Minimal configuration

No ORM dependency

Optional logging

Stored procedure support

Transaction support

Suitable for small to medium applications

๐Ÿ“ฆ Installation dotnet add package MyCompany.DataLite

โš™๏ธ Basic Configuration var config = new DbConfig { ProviderName = "Microsoft.Data.SqlClient", ConnectionString = "your-connection-string" };

IDatabase database = new Database(config); ICrudRepository crud = new CrudRepository(database);

๐Ÿ—‚ Table Name Best Practice

Always define table names as constants to avoid SQL injection risks.

public static class DbTables { public const string Members = "Members"; }

โž• INSERT crud.Insert( DbTables.Members, new Dictionary<string, object> { { "Name", "Nilesh" }, { "Email", "test@email.com" }, { "CreatedOn", DateTime.UtcNow } });

Notes

Keys = column names

Values = column values

null values are converted to DBNull.Value

โœ๏ธ UPDATE crud.Update( DbTables.Members, new Dictionary<string, object> { { "Email", "updated@email.com" }, { "UpdatedOn", DateTime.UtcNow } }, "MemberId = @MemberId", new Dictionary<string, object> { { "@MemberId", 10 } });

Notes

Only provided fields are updated

WHERE clause must be parameterized

โŒ DELETE crud.Delete( DbTables.Members, "MemberId = @MemberId", new Dictionary<string, object> { { "@MemberId", 10 } });

Notes

Always use a WHERE clause

Prevents accidental mass deletion

๐Ÿ” SELECT DataTable table = crud.Select( DbTables.Members, columns: "MemberId, Name, Email", whereClause: "IsActive = @IsActive", whereParams: new Dictionary<string, object> { { "@IsActive", true } });

Select All Rows DataTable table = crud.Select(DbTables.Members);

๐Ÿงช Stored Procedure Execution var spExecutor = new StoredProcedureExecutor(database);

DataTable result = spExecutor.Execute( "GetActiveMembers", new Dictionary<string, object> { { "@DepartmentId", 2 } });

Insert And Return Identity

int id = db.InsertAndReturnId(
    "Datasets",
    new Dictionary<string, object>
    {
        ["DatasetName"] = "Finance Report",
        ["Year"] = 2025,
        ["Department"] = "Accounts"
    }
);

๐Ÿ” Transaction Support
using var scope = new DbTransactionScope(database);

crud.Insert(DbTables.Orders, orderFields);
crud.Insert(DbTables.OrderItems, itemFields);

scope.Commit();

๐Ÿงพ Logging (Optional)

Implement IDbLogger to trace SQL execution:

public class ConsoleDbLogger : IDbLogger
{
    public void Log(string sql, Dictionary<string, object> parameters)
    {
        Console.WriteLine(sql);
    }
}


Pass it to CrudRepository if required.

๐Ÿ” Security Notes

Table names must come from trusted code (constants)

Values are always parameterized

Avoid passing raw user input as identifiers

๐Ÿง  When to Use DataLite

โœ” Simple CRUD needs
โœ” Reporting systems
โœ” Legacy databases
โœ” Lightweight services

โŒ Complex domain modeling
โŒ Heavy object tracking
โŒ LINQ-based querying

๐Ÿ“„ License

MIT License

๐Ÿš€ Roadmap

Async CRUD methods

Pagination helpers

Insert-and-return-id support

Soft delete utilities

๐Ÿค Contribution

Contributions, issues, and suggestions are welcome.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.1.1.6 111 9/9/2026
1.1.1.5 128 7/12/2026
1.1.1.4 127 3/3/2026
1.1.1.3 130 1/5/2026
1.1.1.2 125 1/1/2026
1.1.1.1 128 1/1/2026
1.1.1 139 1/1/2026
1.1.0 210 12/23/2025
1.0.0 189 12/21/2025

- Added support for asynchronous database operations in CRUD methods.
- Added support for asynchronous execution of stored procedures.
- Added XML documentation comments for public API surface to remove missing XML comment warnings and improve IntelliSense:
- StoredProcedures/SpParam.cs โ€” documented Name, Value and constructor.
- CRUD/ICrudRepository.cs โ€” documented Execute, ExecuteAsync, Query, QueryAsync, InsertAndReturnId, SelectList/SelectListAsync, QueryList/QueryListAsync and related parameters/return values.
- Extensions/DataTableExtensions.cs โ€” documented class and ToList extension method.
- Verified solution builds successfully after changes.