Comments (3)
Hi @OculiViridi , unfortunately the library doesn't support this use case at the moment; it supports the following simple types or complex types.
Having said that, what if you project your enum as its underlying data type –assuming byte
per your stub– and use that instead? like this:
...
if (filter.OperationTypes?.Any() == true)
{
// Conversion from API enum model to EF enum model
// *** Notice the cast to byte ***
var operationTypes = filter.OperationTypes.Select(c => Enum.Parse<Data.Models.OperationType>(c.ToString(), true)).Select(i => (byte)i);
// Call to AsQueryableValues that causes the Exception
var queryableValues = _dbContext.AsQueryableValues(operationTypes);
// *** Notice the cast to byte ***
query = query.Where(x => x.Movements.OperationType != null && queryableValues.Contains((byte)x.Movements.OperationType.Value));
}
...
If byte
doesn't work, try with int
.
from blazartech.queryablevalues.
If
byte
doesn't work, try withint
.
Seems to work fine both with byte
and with int
.
from blazartech.queryablevalues.
Tasks
-
IEnumerable<Enum>
-
Enum
property in complex type (IEnumerable<ComplexType>
) - Update docs
from blazartech.queryablevalues.
Related Issues (20)
- Is there a way to compose a query that uses a condition of contains in two lists (AND not OR)? HOT 7
- Non-intrusive Mode HOT 1
- Json Serialization Support HOT 2
- Naming for Entity Framework 7 and above HOT 1
- MySql support? HOT 2
- Does/Can this work with enum values? HOT 2
- EFCore InternalServiceProvider is not supported HOT 1
- Unable to cast object of type 'BlazarTech.QueryableValues.DeferredInt32Values' to type 'System.String'. HOT 12
- Support for DateOnly/TimeOnly?
- ToQueryString does not work HOT 2
- The generic AsQueryableValues throws if options are provided.. HOT 18
- QueryableValues fails when joining against a query that uses the Include method HOT 2
- Possibility of using implicit version of OpenJson? HOT 3
- Entity Framework Core 8 (.NET 8) Support HOT 7
- Joining entities with table HOT 1
- Better execution plans HOT 2
- Incompatibility with Microsoft.IO.RecyclableMemoryStream 3.0.0 HOT 4
- EF.Property<T> throws exception with list used in AsQueryableValues() extension HOT 2
- Doesn't work with compiled models
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazartech.queryablevalues.