OrmTxcSql 2.1.0
dotnet add package OrmTxcSql --version 2.1.0
NuGet\Install-Package OrmTxcSql -Version 2.1.0
<PackageReference Include="OrmTxcSql" Version="2.1.0" />
<PackageVersion Include="OrmTxcSql" Version="2.1.0" />
<PackageReference Include="OrmTxcSql" />
paket add OrmTxcSql --version 2.1.0
#r "nuget: OrmTxcSql, 2.1.0"
#:package OrmTxcSql@2.1.0
#addin nuget:?package=OrmTxcSql&version=2.1.0
#tool nuget:?package=OrmTxcSql&version=2.1.0
OrmTxcSql
O/R mapping, Transaction control, SQL
Overview
OrmTxcSql is a lightweight O/R mapping, transaction control, and SQL execution library for .NET applications.
Packages
- OrmTxcSql - Core library
- OrmTxcSql.Npgsql - PostgreSQL support
- OrmTxcSql.SqlClient - SQL Server support
- OrmTxcSql.DB2 - IBM DB2/iSeries support
Supported Frameworks
- .NET 10.0
- .NET 8.0
- .NET 6.0
- .NET Framework 4.8
Installation
# PostgreSQL
dotnet add package OrmTxcSql.Npgsql
# SQL Server
dotnet add package OrmTxcSql.SqlClient
# IBM DB2/iSeries
dotnet add package OrmTxcSql.DB2
Basic Usage
Entity Definition
[Table("products")]
public class ProductEntity : BaseNpgsqlEntity
{
[Column("product_code"), PrimaryKey]
public string ProductCode { get; set; }
[Column("description")]
public string Description { get; set; }
}
DAO Implementation
public class ProductDao : BaseNpgsqlDao<ProductEntity>
{
public override ProductEntity[] Select(ProductEntity entity)
{
// table name
string tableName = EntityUtils.GetTableName<ProductEntity>();
// column names
string[] columnNames = EntityUtils.GetColumnAttributes<ProductEntity>()
.Select(prop => new
{
PropertyInfo = prop,
ColumnName = prop.GetCustomAttribute<ColumnAttribute>(false)?.ColumnName ?? String.Empty
})
.Where(src => !String.IsNullOrEmpty(src.ColumnName))
.Select(src => src.ColumnName)
.ToArray();
//
// sql
var builder = new StringBuilder();
builder.Append(" select");
builder.Append(String.Join(",", columnNames.Select(columnName => String.Format(" x.{0}", columnName))));
builder.Append(this.GetCommonFieldForSelect("x"));
builder.Append(" from ").Append(tableName).Append(" as x");
builder.Append(" where");
builder.Append(" x.product_code like @parameter_product_code_prefix || '%'");
builder.Append(this.GetCommonFieldForSelectCondition("x", true));
//
// set up command text
NpgsqlCommand command = this.Command;
command.CommandText = builder.ToString();
// set up command parameters
NpgsqlServer.AddParameterOrReplace(command, "@parameter_product_code_prefix", NpgsqlDbType.Varchar, entity.ProductCode);
//
// prepara command
command.Prepare();
//
// return result
DataTable dt = this.GetDataTable(command);
ProductEntity[] result = dt.AsEnumerable<ProductEntity>().ToArray();
return result;
}
}
Data Source Configuration
// PostgreSQL
var dataSource = new NpgsqlDataSource("Host=localhost;Database=mydb;Username=user;Password=pass");
// SQL Server
var dataSource = new SqlClientDataSource("Server=localhost;Database=mydb;Integrated Security=true");
Key Features
- Simple O/R mapping
- Automatic transaction management
- Parameterized query support
- Multiple database support
- Lightweight and high performance
License
MIT License
Repository
| Product | Versions 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 is compatible. 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 is compatible. 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 Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- NLog (>= 6.0.7)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
net10.0
- NLog (>= 6.0.7)
-
net6.0
- NLog (>= 6.0.7)
-
net8.0
- NLog (>= 6.0.7)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on OrmTxcSql:
| Package | Downloads |
|---|---|
|
OrmTxcSql.DB2
OrmTxcSql.DB2 helps you with O/R mapping, Transaction control, and running SQL. |
|
|
OrmTxcSql.Npgsql
OrmTxcSql.Npgsql helps you with O/R mapping, Transaction control, and running SQL. |
|
|
OrmTxcSql.SqlClient
OrmTxcSql.SqlClient helps you with O/R mapping, Transaction control, and running SQL. |
|
|
OrmTxcSql.Odbc
OrmTxcSql.Odbc helps you with O/R mapping, Transaction control, and running SQL. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0 | 206 | 2/3/2026 |
| 2.0.8 | 298 | 9/2/2025 |
| 2.0.7 | 318 | 8/30/2025 |
| 2.0.6 | 244 | 7/5/2025 |
| 2.0.5 | 314 | 12/27/2024 |
| 2.0.3 | 310 | 10/17/2024 |
| 2.0.2 | 321 | 9/16/2024 |
| 2.0.1.1 | 299 | 9/13/2024 |
| 2.0.1 | 335 | 5/31/2024 |
| 2.0.0.1 | 443 | 6/19/2023 |
| 2.0.0 | 389 | 6/12/2023 |
| 1.2.0 | 1,300 | 11/16/2022 |
| 1.1.1 | 1,403 | 8/24/2022 |
| 1.1.0 | 1,362 | 7/22/2022 |
| 1.0.10.1 | 620 | 6/17/2022 |
| 1.0.10 | 1,731 | 6/10/2022 |
| 1.0.9 | 619 | 6/9/2022 |
| 1.0.8 | 1,427 | 4/26/2022 |
| 1.0.7 | 992 | 11/3/2021 |
| 1.0.6 | 980 | 11/2/2021 |