mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 优化 DbContext/Repository ManyToMany联级保存功能,当是新增数据时不查询中间表记录对比差异(直接插入);
This commit is contained in:
@ -128,6 +128,14 @@ namespace FreeSql
|
||||
return this;
|
||||
}
|
||||
|
||||
Dictionary<Type, DbSet<object>> _dicDbSetObjects = new Dictionary<Type, DbSet<object>>();
|
||||
DbSet<object> GetDbSetObject(Type et)
|
||||
{
|
||||
if (_dicDbSetObjects.TryGetValue(et, out var tryds)) return tryds;
|
||||
_dicDbSetObjects.Add(et, tryds = _db.Set<object>().AsType(et));
|
||||
return tryds;
|
||||
}
|
||||
|
||||
public class EntityState
|
||||
{
|
||||
public EntityState(TEntity value, string key)
|
||||
|
Reference in New Issue
Block a user