You haven't executed the query; you need to materialize it: await query.ToListAsync or await query.ToEnumerableAsync. You'll also need to use listLocs.AddRange versus Add
, since you may get 0, 1 or multiple rows back.
On another note how many items do you expect in PlatypiIds
? Your loop looks like it's making at least two service calls for each item, so you may want to test if the chattiness has an impact on end user experience and instead try to grab all the data with one or two queries.