I'm trying to return a List<Item>
by feeding a List<Guid>
to a repository method as such
public async Task<List<Item>> GetListOfItems(List<Guid> guids)
{
}
I thought about making a GetById
call in a foreach
loop but I figured this many calls to the DB will just be inefficient.
I also thought about maybe using context.Items.Where(x => x...Contains(guids))
but I don't know how to write it right.
The thing is I'm trying to do this efficiently, hopefully using EF Core but if not possible then using a stored procedure in SQL would do the job.
I'm not advanced enough to figure out the SQL so if it's possible in EF Core that would be awesome.