I have a question how to write a lambda expression, it works for me in the mssql request, for example:
SELECT KUNDNR
FROM halldb.dbo.KUND
wWHERE NOT EXISTS
(
SELECT KundID
FROM halldb.dbo.KundInfo
WHERE KUNDNR = CONVERT(Varchar(50), KundInfo.KundID)
)
ORDER BY KUNDNR
And what I was trying to use a lambda expression was as follows:
db.KUNDs.Select(x => x).Except(db.KundInfos.Select(x => x));
But since KUNDs and KundInfo are two different types of objects that don't work ... I could do this:
db.KUNDs.Select(x => x.KUNDNR).Except(db.KundInfos.Select(x => x.KundID.ToString()));
But that just gives me a list with strings with KUNDs.KUNDNR when I really would like to get a list with KUNDs objects.
How can i do this?
Help would be greatly appreciated!
source
share