c# - Get complex object using IN equivalent in LINQ -


i have list of type customer. need insert values of list in database before checking if customer same customer number exists particular client. firing query me customers there in database having customer number equal ones in list. query writing not working, here's code.

customerrepository.find(x => x.clientid == clientid)             .where(x => x.customernumber.contains(lstcustomersinserted.select(c => c.customernumber))); 

keep simple:

var lstcustomernumbers = lstcustomersinserted.select(c => c.customernumber);     var res = customerrepository.where(x => x.clientid == clientid && lstcustomernumbers.any(c => c == x.customernumber)); 

Comments

Popular posts from this blog

ios - UITEXTFIELD InputView Uipicker not working in swift -

Hatching array of circles in AutoCAD using c# -