在我的 WPF Grid 上,我正在填充以下属性。最后两个来自另一张桌子。我想从另一个表中获取映射规则,其中sourceelementid
事务表等于id
表messagefield
的
public List<MessageFieldViewModel> GetAllViewModelMsgFields()
{
messageFieldVModel = messageField.GetAllMessageField().Select(msgFields => new MessageFieldViewModel
{
Id = msgFields.Id,
Code = msgFields.Code,
Name = msgFields.Name,
Position = msgFields.Position,
Length = msgFields.Length,
IsMapped = (transactionRuleList.Any(tr=> tr.SourceElementId ==msgFields.Id)),
MappingRule = transactionRuleList.Where(mapRule => mapRule.MappingRule.Any(tr=> tr.SourceElementId ==msgFields.Id)),
})
.ToList();
return messageFieldVModel;
}
但映射规则列会引发错误。有人能帮我吗 ?