public string[] FindAssets2()
{
string[] result;
using (var ctx = new StockContext())
{
var predicate = PredicateBuilder.New<Asset>().Or(asset => asset.Symbol.Contains("TSLA"));
result = ctx.Assets.AsExpandable()
.Where(predicate)
.Select(z => z.Symbol)
.ToArray();
}
return result;
}
Just a piece of simple codes. It throws me
Exception: Unhandled expression type: 'Extension'
LinqKit.ExpressionVisitor.Visit(Expression exp)
LinqKit.ExpressionVisitor.VisitExpressionList(ReadOnlyCollection<Expression> original)
LinqKit.ExpressionVisitor.VisitMethodCall(MethodCallExpression m)
LinqKit.ExpressionVisitor.Visit(Expression exp)
LinqKit.Extensions.Expand(Expression expr)
LinqKit.ExpandableQueryProvider<T>.System.Linq.IQueryProvider.CreateQuery<TElement>(Expression expression)
System.Linq.Queryable.Where<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
Below is my installed package
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0-preview.4.20220.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0-preview.4.20220.10" />
<PackageReference Include="LINQKit.Core" Version="1.1.17" />
Any help would be appreciate. Many thanks!
predicate
say it is when you hover over it in Visual Studio? – CryoscopyToString()
it - what does it look like? – Misapprehendhttps://www.nuget.org/packages/Microsoft.EntityFrameworkCore/5.0.0-preview.2.20120.8
. THIS IS THE ONLY VERSION WHICH WORK WITH LINQKIT AT THE MOMENT. – Durand