I need to pass in ids to a webapi controller and return the result. I am currently passing in the ids as a array of objects. I need to match the ids with a dataset and return the result. I found a couple of posts that I am trying to use.
return db.markets.Where(x => db.markets.Contains(x.x_market_code));
this does not work because the it is not a string or list? I have tried to convert the array to a string or list and i have not got anywhere.
here is code
public class marketIds
{
public int x_market_code { get; set; }
}
[HttpPost]
[Route("getAssignedMarkets")]
public IQueryable GetAssignedMarkets(marketIds[] arry)
{
return db.markets.Where(x => arry.Contains(x.x_market_code));
}
I can change how i pass the ids in javascript if need be.

.ToList();at the end of your code??