mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 修复 DbContext TrackList 对匿名对象处理的 bug;#150
This commit is contained in:
parent
dee1d9af8b
commit
65e3ed0091
@ -79,6 +79,7 @@ namespace FreeSql
|
|||||||
var itemType = item.GetType();
|
var itemType = item.GetType();
|
||||||
if (itemType == typeof(object)) return;
|
if (itemType == typeof(object)) return;
|
||||||
if (itemType.FullName.StartsWith("Submission#")) itemType = itemType.BaseType;
|
if (itemType.FullName.StartsWith("Submission#")) itemType = itemType.BaseType;
|
||||||
|
if (_db.Orm.CodeFirst.GetTableByEntity(itemType) == null) return;
|
||||||
var dbset = _db.Set(itemType);
|
var dbset = _db.Set(itemType);
|
||||||
dbset?.GetType().GetMethod("TrackToList", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(dbset, new object[] { list });
|
dbset?.GetType().GetMethod("TrackToList", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(dbset, new object[] { list });
|
||||||
return;
|
return;
|
||||||
|
@ -110,6 +110,13 @@
|
|||||||
清空状态数据
|
清空状态数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:FreeSql.DbSet`1.RemoveAsync(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})">
|
||||||
|
<summary>
|
||||||
|
根据 lambda 条件删除数据
|
||||||
|
</summary>
|
||||||
|
<param name="predicate"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:FreeSql.DbSet`1.Add(`0)">
|
<member name="M:FreeSql.DbSet`1.Add(`0)">
|
||||||
<summary>
|
<summary>
|
||||||
添加
|
添加
|
||||||
|
@ -29,6 +29,14 @@ namespace FreeSql.Tests
|
|||||||
using (var ctx = g.sqlite.CreateDbContext())
|
using (var ctx = g.sqlite.CreateDbContext())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var test150 = ctx.Set<Tag>()
|
||||||
|
.Select.From<Tag>((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<Song>().Select
|
var songs = ctx.Set<Song>().Select
|
||||||
.IncludeMany(a => a.Tags)
|
.IncludeMany(a => a.Tags)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user