0
在存储库中,我需要在searchCriteria(sc)中定义的其他功能集合中搜索联系人(c)的功能。表达Func键看起来是这样的:linq to entities:嵌套.Any()
// 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.
**今天感觉奥运吗?**你很勇敢的做EF做这样的事情。 ;) – 2011-02-01 14:53:57