dashing icon indicating copy to clipboard operation
dashing copied to clipboard

Generics in where clause not working as expected

Open Conaugh opened this issue 6 years ago • 0 comments

I have several base entities, all with similar stuctures, which all inherit from an interface. When querying a parent object, the interface type is used rather than the concrete type.

e.g. ApplyTagsSearch<TEntity, TTag>(this ISelectQuery<TEntity> query) where TEntity : class, IHasTags<TTag, TEntity>, new() where TTag : IIAmTag<TEntity> { query.Where(o => o.Tags.Any(ot => tags.Contains(ot.Tag.TagId))); } tags is an int[] of tag IDs

The exception thrown by Dashing is "Type IIAmTag`1 is not mapped"

Conaugh avatar Sep 18 '19 10:09 Conaugh