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

  • Home
  • SEARCH
  • 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 6191291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:44:18+00:00 2026-05-24T02:44:18+00:00

now I can not get the correct information List<HeaderHelper> h = pr.Actual_View(); foreach (TemplateHeader

  • 0

now I can not get the correct information

   List<HeaderHelper> h = pr.Actual_View();
   foreach (TemplateHeader t in pr.TemplateView()) 
   {
      var v= h.Where(z => z.Country == t.Pais 
                       && z.dia == t.diaTotal 
                       && z.Segment == t.Segmento).FirstOrDefault();
   }

The

    pr.Actual_View()

is a class method for a list containing the following fields:

  • Country (string)
  • dia (int)
  • Segment (string)

The

    pr.TemplateView()

is a class method for list containing the same fields and same datatype

the list t may contain more information than the list h, so I need to filter the list h with several criteria, but when I run the code does not correctly filter the list, returning a null.

  • 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-24T02:44:19+00:00Added an answer on May 24, 2026 at 2:44 am

    If v is null, that suggests that none of the values in t matched your Where clause, so FirstOrDefault returned the default value of TemplateHeader, which is null.

    Without more information or sample data we’ve got absolutely no way of knowing why none of the values in t matched, but that’s what the null value of v indicates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Now while I know that you can not perform inheritance like you would in
newthing = Link(user=request.user,last_updated=datetime.datetime.now()) However, this uses datetime , not the MYSQL now(). How can
I have a DataGrid . I have DataGridDragDropTarget from November Toolkit. I now can
Now I can add single value or tubles to the pipeline, my next question
Right now I can use this URL to request a Google Static Maps image
I have several timers that poll information off the internet. When I get an
This has been bugging me for 2 days now and I cant get my
preface: I've been stumped on this for awhile now and am not having much
BUMP: This is not a dead request. I'm still hoping to get a solid
Ive tried searching for hours now and cannot find out why my code (aka,

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.