mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 修复 PgArrayToMany DTO 异步查询报错的 bug(同步方法正常);
This commit is contained in:
parent
f321354749
commit
330abdf897
@ -800,5 +800,14 @@
|
||||
<param name="that"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Microsoft.Extensions.DependencyInjection.FreeSqlRepositoryDependencyInjection.AddFreeRepository(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{FreeSql.FluentDataFilter},System.Reflection.Assembly[])">
|
||||
<summary>
|
||||
批量注入 Repository,可以参考代码自行调整
|
||||
</summary>
|
||||
<param name="services"></param>
|
||||
<param name="globalDataFilter"></param>
|
||||
<param name="assemblies"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
@ -1536,6 +1536,17 @@ namespace FreeSql.Internal.CommonProvider
|
||||
var bindings = new List<MemberBinding>();
|
||||
if (imni.IsOutputPrimary) bindings.AddRange(imni.Table.Primarys.Select(a => Expression.Bind(imni.Table.Properties[a.CsName], Expression.MakeMemberAccess(imni.CurrentExpression, imni.Table.Properties[a.CsName]))));
|
||||
if (imni.Childs.Any()) bindings.AddRange(imni.Childs.Select(a => Expression.Bind(imni.Table.Properties[a.Key], GetIncludeManyNewInitExpression(a.Value))));
|
||||
var pgarrayToManys = imni.Table.GetAllTableRef().Select(tr =>
|
||||
{
|
||||
if (tr.Value.RefType != TableRefType.PgArrayToMany) return null;
|
||||
var reftb = _orm.CodeFirst.GetTableByEntity(tr.Value.RefEntityType);
|
||||
if (tr.Value.RefColumns[0] == reftb.Primarys[0])
|
||||
{
|
||||
bindings.Add(Expression.Bind(imni.Table.Properties[tr.Value.Columns[0].CsName], Expression.MakeMemberAccess(imni.CurrentExpression, imni.Table.Properties[tr.Value.Columns[0].CsName])));
|
||||
return tr.Key;
|
||||
}
|
||||
return null;
|
||||
}).ToList();
|
||||
return Expression.MemberInit(imni.Table.Type.InternalNewExpression(), bindings);
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ constantine,
|
||||
[mafeng8](https://github.com/mafeng8),
|
||||
[VicBilibily](https://github.com/VicBilibily),
|
||||
[Soar](https://github.com/sgf),
|
||||
QLR etc.
|
||||
[quzhen91](https://github.com/quzhen91) etc.
|
||||
|
||||
## 💕 Donation
|
||||
|
||||
|
@ -211,7 +211,7 @@ constantine,
|
||||
[mafeng8](https://github.com/mafeng8),
|
||||
[VicBilibily](https://github.com/VicBilibily),
|
||||
[Soar](https://github.com/sgf),
|
||||
QLR 等。
|
||||
[quzhen91](https://github.com/quzhen91) 等。
|
||||
|
||||
## 💕 Donation (捐赠)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user