巽翎君的开源代码库
轻量级的.NET跨平台数据库查询组件库.
Lightweight .NET cross-platform database query component library.
兼容性(Compatibility) :
.NET Framework >= 4.6.1
.NET Core >= 2.0
数据库支持 (Supported databases):
Microsoft SQL Server
PostgreSQL
MySQL
SQLite3
更多信息请阅读 Documents 目录下的开发人员文档
For more information, please read the developers documentation in the "Documents" directory.
右键点击项目打开“管理NuGet程序包”,并搜索关键字 “Wunion.DataAdapter.NetCore” 安装相应的包,您也可以自行编译nuget包发布到自己的Nuget服务器上。
Right-click on your project open the NuGet Package Manager, Search keyword: "Wunion.DataAdapter.NetCore" for installation. And you can also compile and publish your own NuGet package to your own NuGet server
作者将会随时更新并改进组件库,同时欢迎各路开发人员加入该项目的开发及完善工作。 The author would update and improve the component library at any time, and welcome many developers to join the project development and improvement work.
BatchCommander类的使用 (Use of the BatchCommander class):
命名空间 (Namespace) :Wunion.DataAdapter.Kernel
示例:
int result = 0;
using (BatchCommander commander = BatchCommander(dataEngine))
{
DbCommandBuilder cb = new DbCommandBuilder();
cb.Insert(......).Values(......);
result = commander.ExecuteNonQuery(cb);
......
cb.Update(...).Set(......).Where(......);
result = commander.ExecuteNonQuery(cb);
......
}
DataBatchProccesser类的使用(Use of the DataBatchProccesser class):
命名空间 (Namespace) :Wunion.DataAdapter.EntityUtils
示例:
using (DataBatchProcessor p = DbContext.BatchProcess())
{
int result = p.Table<MyTestContext>().Update(entity, p => new object[] { p.Id == 2 });
if (result < 1)
result = p.Table<MyTestContext>().Add(entity);
...
}