我正在使用最新版本的第三代和积极记录。 我正试图让一位左派加入《准则》。 它在SubSonic的某个地方出现错误。
车辆可能有多种图像,但不需要。 a 因此,加入是适当的。
这就是我所说的话。
var vehicle = from v in Vehicle.All()
join dl in DealerLocation.All() on v.DealerLocationID equals dl.ID
join vi in VehicleImage.All() on v.ID equals vi.VehicleID into VehicleImages
from vij in VehicleImages.DefaultIfEmpty()
&& vij.IsPrimary
select new
{
v, vij.Image
};
这是我发现的错误。
The expression of type System.Linq.IQueryable`1[<>f__AnonymousType1`2[<>f__AnonymousType0`2[Project.Data.Vehicle,Project.Data.DealerLocation],System.Collections.Generic.IEnumerable`1[Project.Data.VehicleImage]]] is not a sequence
这是 st痕。
at SubSonic.Linq.Translation.QueryBinder.ConvertToSequence(Expression expr) at SubSonic.Linq.Translation.QueryBinder.VisitSequence(Expression source) at SubSonic.Linq.Translation.QueryBinder.BindSelectMany(Type resultType, Expression source, LambdaExpression collectionSelector, LambdaExpression resultSelector) at SubSonic.Linq.Translation.QueryBinder.VisitMethodCall(MethodCallExpression m) at SubSonic.Linq.Structure.ExpressionVisitor.Visit(Expression exp) at SubSonic.Linq.Structure.DbExpressionVisitor.Visit(Expression exp) at SubSonic.Linq.Translation.QueryBinder.Visit(Expression exp) at SubSonic.Linq.Translation.QueryBinder.Bind(QueryMapping mapping, Expression expression) at SubSonic.Linq.Structure.QueryMapping.Translate(Expression expression) at SubSonic.Linq.Structure.DbQueryProvider.Translate(Expression expression) at SubSonic.Linq.Structure.DbQueryProvider.GetExecutionPlan(Expression expression) at SubSonic.Linq.Structure.DbQueryProvider.Execute(Expression expression) at SubSonic.Linq.Structure.QueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) at SubSonic.Linq.Structure.Query`1.GetEnumerator() at System.Linq.SystemCore_EnumerableDebugView`1.get_Items()
预先感谢任何见解。