You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List of necessary types is stored at the HashSet<OperationType.Code> typeList variable.
On 2.2. this query works OK. On 3.0.0-rc1 it fails with an error:
System.InvalidOperationException: 'The LINQ expression 'Where<Operation>(
source: DbSet<Operation>,
predicate: (o) => HashSet<Code> { Submission, Reset, Calculate, ESIPaymentReport, Retraction, RetractionUndo, MoveRecord, MoveRecordUndo, CVSCAG, BIUpdate, }.Contains(o.Type) && o.DeleteDate == null && o.PeriodID == (Unhandled parameter: __parameters_PeriodID_0))' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync().
If I change HashSet to List, the query works.
Can HashSet be translated as List for queries?
Further technical details
EF Core version: 3.0.0-rc1.19456.14
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.0
Operating system: Windows 10
IDE: Visual Studio 2019 16.3 Preview 4
The text was updated successfully, but these errors were encountered:
I have a quite simple table named Operation and class for it. It has a property named Type mapped to an enum:
I try to request all operations with a filter by type and other fields:
List of necessary types is stored at the HashSet<OperationType.Code> typeList variable.
On 2.2. this query works OK. On 3.0.0-rc1 it fails with an error:
If I change HashSet to List, the query works.
Can HashSet be translated as List for queries?
Further technical details
EF Core version: 3.0.0-rc1.19456.14
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.0
Operating system: Windows 10
IDE: Visual Studio 2019 16.3 Preview 4
The text was updated successfully, but these errors were encountered: