c# - Linq join vs contains cast error -


i having issue perplexing me no end. have 2 ways compose on existing linq query. 1 of works.

working:

var splitstatuses = context.split(model.statuses, "statuses"); query = query.where(x => splitstatuses.contains(x.statusfk)); 

not working:

query =   qry in query   join status in context.split(model.statuses, "statuses") on qry.statusfk equals status   select qry; 

the query calling tvf , filtering results based off of return. non-working query works if count, when data, cast error:

system.invalidcastexception: specified cast not valid.    @ system.data.sqlclient.sqlbuffer.get_int32() 

maybe ef/linq wizard can shed light onto why happening.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -