yv989c / BlazarTech.QueryableValues

This library allows you to efficiently compose an IEnumerable<T> in your Entity Framework Core queries when using the SQL Server database provider.
Other
93 stars 6 forks source link

Does/Can this work with enum values? #23

Closed bzbetty closed 1 year ago

bzbetty commented 1 year ago

I notice there's no overloads specifically for them, so i tried the generic overload

public static IQueryable AsQueryableValues(this DbContext dbContext, IEnumerable values, Action<EntityOptionsBuilder>? configure = null) where TSource : notnull

but that resulted in an exception.

Is this a supported scenario already?

bzbetty commented 1 year ago

seems that casting the enum to a primitive works, bit ugly but it works

ctx.AsQueryableValues(args.jobTypes!.Cast()).Contains((int)i.TypeId)

yv989c commented 1 year ago

Hi! I'll close the issue now. If there's anything else feel free to open a new one.

Thanks.