我有一家包含地址对象的公司。SQL 返回是平坦的,我试图让 Query<> 加载所有对象。
cnn.Query<Company,Mailing,Physical,Company>("Sproc",
(org,mail,phy) =>
{
org.Mailing = mail;
org.Physical = phy;
return org;
},
new { ListOfPartyId = stringList }, null, true, commandTimeout: null,
commandType: CommandType.StoredProcedure, splitOn: "MailingId,PhyscialId").ToList();
我不确定我的 SplitOn 是否正确。我收到消息:
使用多映射 API 时,如果您有除 Id 以外的键,请确保设置 splitOn 参数名称:splitOn
建议会很棒。
Test.cs 中的示例不是代码要求作为查询参数的内容。这些需要更新