使用此代码:
public static async Task<List<DUCKBILLED_PLATYPI>> GetLocationsForPlatypiAndTimeRange(HashSet<string> PlatypiIds, DateTime EarliestToShow, DateTime LatestToShow)
{
List<DUCKBILLED_PLATYPI> listLocs = new List<DUCKBILLED_PLATYPI>();
List<string> PlatypusBillIDList;
string PlatypusBillID;
IMobileServiceTable<DUCKBILLED_PLATYPI> table = App.MobileService.GetTable<DUCKBILLED_PLATYPI>();
MobileServiceTableQuery<DUCKBILLED_PLATYPI> query;
foreach (var item in PlatypiIds)
{
PlatypusBillIDList = await GetPlatypusBillIDForPlatypusID(item);
PlatypusBillID = PlatypusBillIDList[0];
query =
table.Where(l => l.PlatypusBillID == PlatypusBillID).
Where(l => l.UpdateTimeUTC >= EarliestToShow).
Where(l => l.UpdateTimeUTC <= LatestToShow).
OrderBy(l => l.UpdateTimeUTC);
listLocs.Add(query);
}
return listLocs;
}
...我在同一行收到两条错误消息(“ listLocs.Add(query); ”行);他们是:
1) Error 1 The best overloaded method match for 'System.Collections.Generic.List<MetroSandboxPlaypen.TaSLs_Data.DUCKBILLED_PLATYPI>.Add(MetroSandboxPlaypen.TaSLs_Data.DUCKBILLED_PLATYPI)' has some invalid arguments
2) Error 2 Argument 1: cannot convert from 'Microsoft.WindowsAzure.MobileServices.MobileServiceTableQuery<MetroSandboxPlaypen.TaSLs_Data.DUCKBILLED_PLATYPI>' to 'MetroSandboxPlaypen.TaSLs_Data.DUCKBILLED_PLATYPI'