Git Product home page Git Product logo

Comments (3)

yv989c avatar yv989c commented on August 19, 2024 1

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.

OculiViridi avatar OculiViridi commented on August 19, 2024 1

If byte doesn't work, try with int.

Seems to work fine both with byte and with int.

from blazartech.queryablevalues.

yv989c avatar yv989c commented on August 19, 2024 1

Tasks

  • IEnumerable<Enum>
  • Enum property in complex type (IEnumerable<ComplexType>)
  • Update docs

from blazartech.queryablevalues.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.