Quantcast
Channel: C# Grabbing subset of table based off a Hashset if Ints - Stack Overflow
Viewing all articles
Browse latest Browse all 2

C# Grabbing subset of table based off a Hashset if Ints

$
0
0

I have an Order and OrderMaster table. First I query the Master table, I then create a hashset of a column of Ints from that table. Lastly I want to get all orders that have those values.

When I do the contains, the ToList() fails and I get an error

Type bool does not contain member ToList

What am I doing wrong here?

mappings = await _context.OrderMapping                         .Where((OrderMapping em) => em.MOID == UID)                         .ToListAsync();HashSet<int> ids2 = new HashSet<int>((mappings.Select(a => a.ORDERMAPID)));orders = await _context.Order                       .Where(x => ids2.Contains(x.ORDERMAPID)                       .ToListAsync();

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>