I have a stored procedure that is returning data in this format:
HotelID | Price
---------------------
1 | 20
1 | 30
2 | 25
4 | 40
4 | 50
I’m getting the results like so:
ISingleResult<spResult> results = DataContext.sp();
I’d like to get a list of Hotels, based on the data returned from the stored procedure. Something like:
int[] uniqueHotelIds = GetUniqueHotelIdsFromResults(results);
List<Hotel> hotels = (from h in DataContext.Hotels
where uniqueHotelIds.Contains(h.HotelID)
select h).ToList();
I don’t have much experience with ISingleResult, but could you do: