diff --git a/FreeSql.DbContext/DbSet/DbSet.cs b/FreeSql.DbContext/DbSet/DbSet.cs index b5331f1aa..dc4c3b47d 100644 --- a/FreeSql.DbContext/DbSet/DbSet.cs +++ b/FreeSql.DbContext/DbSet/DbSet.cs @@ -79,6 +79,7 @@ internal void TrackToList(object list) var itemType = item.GetType(); if (itemType == typeof(object)) return; if (itemType.FullName.StartsWith("Submission#")) itemType = itemType.BaseType; + if (_db.Orm.CodeFirst.GetTableByEntity(itemType) == null) return; var dbset = _db.Set(itemType); dbset?.GetType().GetMethod("TrackToList", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(dbset, new object[] { list }); return; diff --git a/FreeSql.DbContext/FreeSql.DbContext.xml b/FreeSql.DbContext/FreeSql.DbContext.xml index dc0203b8a..d9f91124e 100644 --- a/FreeSql.DbContext/FreeSql.DbContext.xml +++ b/FreeSql.DbContext/FreeSql.DbContext.xml @@ -110,6 +110,13 @@ 清空状态数据 + + + 根据 lambda 条件删除数据 + + + + 添加 diff --git a/FreeSql.Tests/FreeSql.Tests.DbContext/UnitTest1.cs b/FreeSql.Tests/FreeSql.Tests.DbContext/UnitTest1.cs index bc192e749..d9b02940e 100644 --- a/FreeSql.Tests/FreeSql.Tests.DbContext/UnitTest1.cs +++ b/FreeSql.Tests/FreeSql.Tests.DbContext/UnitTest1.cs @@ -29,6 +29,14 @@ public void Include_ManyToMany() using (var ctx = g.sqlite.CreateDbContext()) { + var test150 = ctx.Set() + .Select.From((s, b) => s.InnerJoin(a => a.Id == b.Id)) + .ToList((a, b) => new + { + a.Id,a.Name, + id2 = b.Id, name2 = b.Name + }); + var songs = ctx.Set().Select .IncludeMany(a => a.Tags) .ToList();