I\'ve tried searching for this but couldn\'t find examples that suited my situation.
I have this method for returning customers. How can I use the string array of co
You are backwards:
return g.Customers.Where(x => customerCodesArray.Contains(x.customerCode)).ToList();
I guess this is what you want
return g.Customers.Where(x => customerCodesArray.Contains(x.customerCode)).ToList();
I think you need to reverse the Contains
expression because you want to see if the array contains the customer code, not the other way around.
Try this:
return g.Customers.Where(x => customerCodesArray.Contains(x.customerCode)).ToList();
Try the following code:
return g.Customers.Where(x => customerCodesArray.Contains(x.customerCode)).ToList();
Try
return g.Customers.Where(x=>customerCodesArray.Contains(x.CustomerCode)).ToList();