mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 FreeSql.DbContext 实体对象的变化事件;
> 文档:https://github.com/2881099/FreeSql/wiki/DbContext#%E5%AE%9E%E4%BD%93%E5%8F%98%E5%8C%96%E4%BA%8B%E4%BB%B6 - 补充 Aop.CurdBefore 事件参数 Table 实体类型的元数据;
This commit is contained in:
@ -28,6 +28,11 @@ namespace dbcontext_01.Controllers
|
||||
[HttpGet]
|
||||
async public Task<string> Get()
|
||||
{
|
||||
_orm.SetDbContextOptions(opt => {
|
||||
opt.OnEntityChange = changeReport => {
|
||||
Console.WriteLine(changeReport);
|
||||
};
|
||||
});
|
||||
|
||||
long id = 0;
|
||||
|
||||
@ -150,7 +155,7 @@ namespace dbcontext_01.Controllers
|
||||
|
||||
using (var uow = _orm.CreateUnitOfWork())
|
||||
{
|
||||
|
||||
|
||||
var reposSong = uow.GetRepository<Song, int>();
|
||||
reposSong.Where(a => a.Id > 10).ToList();
|
||||
//查询结果,进入 states
|
||||
|
@ -6,8 +6,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FreeSql.Extensions.LazyLoading" Version="0.10.2" />
|
||||
<PackageReference Include="FreeSql.Provider.Sqlite" Version="0.10.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="4.0.1" />
|
||||
@ -15,7 +13,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Extensions\FreeSql.Extensions.LazyLoading\FreeSql.Extensions.LazyLoading.csproj" />
|
||||
<ProjectReference Include="..\..\FreeSql.DbContext\FreeSql.DbContext.csproj" />
|
||||
<ProjectReference Include="..\..\Providers\FreeSql.Provider.Sqlite\FreeSql.Provider.Sqlite.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user