2020-08-16 02:05:53 +08:00

24 lines
699 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FreeSql AdoNet 扩展包,增加 IDbConnection/IDbTransaction 对象的扩展方法 Select/Insert/Update/Delete 实现 CRUD。
## 如果在 abp-vnext 中使用?
本方法依赖 Volo.Abp.Dapper所以也依赖 Volo.Abp.EntityFrameworkCore
提示FreeSql 兼容 EFCore 99% 的实体特性
> dotnet add package FreeSql.Extensions.AdoNet
```csharp
IDapperRepository repo = ...;
repo.DbConnection.Select<T>().Where(...).ToList();
repo.DbConnection.Insert(new T {}).ExecuteAffrows();
repo.DbConnection.Update().SetSource(new T {}).ExecuteAffrows();
repo.DbConnection.Delete<T>().Where(...).ExecuteAffrows();
IFreeSql fsql = repo.DbConnection.GetFreeSql(); //获取 IFreeSql 实例
```