SqlBatis.DynamicProxy
6.0.0
dotnet add package SqlBatis.DynamicProxy --version 6.0.0
NuGet\Install-Package SqlBatis.DynamicProxy -Version 6.0.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="SqlBatis.DynamicProxy" Version="6.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SqlBatis.DynamicProxy" Version="6.0.0" />
<PackageReference Include="SqlBatis.DynamicProxy" />
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 SqlBatis.DynamicProxy --version 6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SqlBatis.DynamicProxy, 6.0.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.
#:package SqlBatis.DynamicProxy@6.0.0
#: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=SqlBatis.DynamicProxy&version=6.0.0
#tool nuget:?package=SqlBatis.DynamicProxy&version=6.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SqlBatis
A fork of the Apache IBatisNet distribution which has been refactored and migrated to .NET Standard, as shown in the change log.
Releases
Usage
- Install
SqlBatis.DataMappernuget package - Register Sql Mapper in DI
services.AddSqlMapper(options => Configuration.GetSection("DB").Bind(options));
- Configure properties in appsettings.json
{
"DB": {
"Resource": "embedded://MyApp.DataAccess.Configuration.SqlMap.config, MyApp.DataAccess",
"Parameters": {
"connectionString" : "-injected-"
}
}
}
- Use
ISqlMapperin Data Access objects
public class CustomerDao : ICustomerDao
{
public CustomerDao(ISqlMapper mapper)
{
Mapper = mapper;
}
private ISqlMapper Mapper {get;}
public IEnumerable<Customer> GetAll()
{
return Mapper.QueryForList<Customer>("Customers.GetAll", null);
}
public Customer GetById(int id)
{
return Mapper.QueryForObject<Customer>("Customers.GetById", id);
}
public void Insert(Customer customer)
{
Mapper.Insert("Customers.Insert", customer);
}
public void Update(Customer customer)
{
Mapper.Update("Customers.Update", customer);
}
public void Delete(int id)
{
Mapper.Delete("Customers.Delete", id);
}
}
- Setup
Customers.xmlSQL map file (ebmedded or external)
<?xml version="1.0" encoding="UTF-8" ?>
<sqlMap namespace="Customers"
xmlns="http://ibatis.apache.org/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<statements>
<select id="GetAll" resultClass="Customer">
<![CDATA[
SELECT
c.Id,
c.Name,
c.Status,
c.Type
FROM dbo.Customer c
]]>
</select>
<select id="GetById" extends="GetAll" resultClass="Customer">
<![CDATA[
WHERE c.Id = #value#
]]>
</select>
<insert id="Insert">
<![CDATA[
INSERT INTO dbo.Customer (Id, Name, Status, Type)
VALUES(#Id#, #Name#, #Status#, #Type#)
]]>
</insert>
<update id="Update">
<![CDATA[
UPDATE dbo.Customer
SET
Name = #Name#,
Status = #Status#,
Type = #Type
WHERE Id = #Id#
]]>
</update>
<delete id="Delete">
<![CDATA[
DELETE dbo.Customer WHERE Id = #value#
]]>
</delete>
</statements>
</sqlMap>
- Setup
SqlMap.config(embedded or external file)
<?xml version="1.0" encoding="utf-8"?>
<sqlMapConfig xmlns="http://ibatis.apache.org/dataMapper"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<settings>
<setting useStatementNamespaces="true"/>
</settings>
<providers embedded="MyApp.DataAccess.Configuration.providers.config, MyApp.DataAccess"/>
<database>
<provider name="SqlServer"/>
<dataSource name="Primary" connectionString="${connectionString}"/>
</database>
<alias>
<typeAlias alias="Customer" type="MyApp.Model.Customer, MyApp.Model"/>
</alias>
<sqlMaps>
<sqlMap embedded="MyApp.DataAccess.SqlMaps.Customers.xml, MyApp.DataAccess"/>
</sqlMaps>
</sqlMapConfig>
Building
Test Setup
- Requires LocalDB
- Run DBCreation.sql and DataBase.sql to setup the database (see
setupdb.cmd) - SqlServer tests run fine. (Oracle, MySql, PostgreSQL ignored)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Castle.Core (>= 5.2.1)
- SqlBatis.DataMapper (>= 6.0.0)
-
net8.0
- Castle.Core (>= 5.2.1)
- SqlBatis.DataMapper (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SqlBatis.DynamicProxy:
| Package | Downloads |
|---|---|
|
SqlBatis.DataAccess
Data Access Object (DAO) design pattern implementation in SqlBatis (iBATIS.Net) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.0 | 84 | 12/28/2025 |
| 6.0.0-CI.19 | 30 | 12/27/2025 |
| 6.0.0-CI.17 | 31 | 12/27/2025 |
| 6.0.0-CI.15 | 28 | 12/27/2025 |
| 5.1.0 | 654 | 4/18/2021 |
| 5.0.0 | 596 | 12/29/2020 |
| 4.0.0 | 768 | 12/24/2019 |
| 4.0.0-CI-20191224-045351 | 585 | 12/24/2019 |
| 3.0.0 | 7,759 | 3/9/2019 |
Changed iBatisNet to SqlBatis
https://github.com/rasitha1/SqlBatis/blob/master/README.md