Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6883419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:22:52+00:00 2026-05-27T05:22:52+00:00

I have two lists. First one is a list of Tasks pulled from an

  • 0

I have two lists.
First one is a list of Tasks pulled from an API (APITasks), the second one is a list Task that I have on my local SQL DB. The tool allows users to “claim” an APITask and record that claim locally by storing the TaskIssueId.

It can happen that from time to time an APITask gets removed. My tool has code that will notice that and mention it to the user when they list all their “claimed” task.
Now the problem I’m having is getting the user’s tasks to be sorted through the APITasks (sorted by AnotherInternalId which is another Id, complicated and not relevant) and if any task is not available anymore still have it displayed (with my code catching the exception and displaying a message).

Here’s 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 that query but I keep getting a null reference exception error because when the query reaches the local task that is not present in the APITask, d becomes null and everything blows up from there.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:22:53+00:00Added an answer on May 27, 2026 at 5:22 am

    You need check that d is not null, not AnotherInternalId

    myTasks = (from m in myTasksFiltered
               join d in APITasks on m.TaskIssueId equals d.TaskIssueId
                   into joinedData
               from d in joinedData.DefaultIfEmpty()
               let index = d == null ? 0 : d.AnotherInternalId
               orderby index
               select m).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two list on my request on jsp. First one is productGroupName, and
We have two lists: a=['1','2','3','4'] b=['2','3','4','5'] How to get a list with elements that
I have two select list that are equal how do i access the second
I have two lists. At start only the first one has visible elements, the
I have two lists, one from 1 to 10 the other from 1 to
I have two lists one displays cars company and the second one displays all
I have two lists. The first one is hard-coded and the contents never change.
Absolute beginner question here. I have two lists in mathematica. The first one was
I have two drop down lists. Second one is populated based on value chosen
I have two lists of strings that, in a better world, would be one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.