My simple SQL query is
select *
from deletedCards
where cardNumber in (select cardNum from cardInformation
where country = 'NP')
and I need to write it in C#. I've come this far :
var Query1 = dbContext.deletedCards;
Query1.Where(x => dbContext.cardInformation.Where(a => a.country== 'NP')).Select(a => a.cardNum).Contains(x => x.cardNumber);
but this is showing an error
Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type
Can anybody help me write the query correctly? Thanks!