I have two lists. The first one is a list of tasks taken from the API (APITasks), the second is a list of tasks that I have on the local SQL database. The tool allows users to βrequireβ APITask and record this application locally, while retaining TaskIssueId.
It may happen that from time to time the APITask is deleted. My tool has a code that will notice this and mention it to the user when they list their entire "stated" task. Now the problem is that user tasks are sorted through APITasks (sorted by AnotherInternalId, which is another Id, complex and not appropriate), and if any task is not available, it is still displayed (with my code, exception and message display) .
Here is my sql query:
myTasks = (from m in myTasksFiltered join d in APITasks on m.TaskIssueId equals d.TaskIssueId into joinedData from d in joinedData.DefaultIfEmpty() let index = (int?)d.AnotherInternalId ?? 0 orderby index select m).ToList();
This thread helped create this request, but I still get an error with a null reference error, because when the request reaches a local task that is not in APITask, d
becomes zero, and everything explodes there.
source share