【发布时间】:2011-02-01 23:28:04
【问题描述】:
在存储库中,我需要搜索联系人 (c) 的特征,以查找在 searchCriteria (sc) 中定义的其他特征的集合。表达式函数如下所示:
// no Problem from here --->
c => c.firstName.StartsWith(sc.FirstName)
&& c.lastName.StartsWith(sc.LastName)
&& c.addressData.Any(a => a.City.StartsWith(sc.City))
&& c.addressData.Any(a => a.StreetAddr.StartsWith(sc.Street))
&& c.addressData.Any(a => a.ZIPCode.StartsWith(sc.ZipCode))
&& c.visit.Any(v=> v.vStartDate >= sc.VisitTimeIntervalStart)
&& c.visit.Any(v => v.vStartDate <= sc.VisitTimeIntervalEnd)
// <-- to here but this ->
&& c.contact2feature.Any(
c2f => sc.FeaturePattern.Any(
` fp => fp.Item1.featureID == c2f.feature.featureID))
// thows: System.Reflection.TargetInvocationException
// Inner: Unable to process the type System.Tuple 2[], because it has no known mapping to the value layer.
【问题讨论】:
-
今天感觉像奥运一样?你很勇敢地和英孚一起做这样的事情。 ;)
标签: entity-framework-4 linq-to-entities