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 7160717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:26:39+00:00 2026-05-28T13:26:39+00:00

I have this Linq and what I tried to do to set the element

  • 0

I have this Linq and what I tried to do to set the element into the hashset and doesn’t work what’s missing?? When I debugged the result always show me the property empty

var estructura = (from result in query
       select new Estructura()
       {
           IdEstructura = result.Servicio.Campana.Cliente.Direccion.IdDireccion,
           Descripcion = result.Servicio.Campana.Cliente.Direccion.Descripcion,
           lstEstructurasHijos = new HashSet<Estructura>().Select(
            C => new Estructura()
            {
                IdEstructura = result.Servicio.Campana.Cliente.IdCliente,
                Descripcion = result.Servicio.Campana.Cliente.Descripcion,
                lstEstructurasHijos = new HashSet<Estructura>().Select(
                 CA => new Estructura() 
                 { 
                    IdEstructura = result.Servicio.Campana.IdCampana,
                    Descripcion = result.Servicio.Campana.Descripcion,
                    lstEstructurasHijos = new HashSet<Estructura>().Select(
                    S => new Estructura()
                    {
                        IdEstructura = result.Servicio.IdServicio,
                        Descripcion = result.Servicio.Descripcion,
                        lstEstructurasHijos = new HashSet<Estructura>()
                    })
                 })
            })

       });
  • 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-28T13:26:40+00:00Added an answer on May 28, 2026 at 1:26 pm

    You are misusing the selecton the HashSet like this one:

    new HashSet<Estructura>().Select(//... Means take from that new HashSet....
    

    Of course a new HashSet won’t contain anything. This’s why you get empty HashSets.

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

Sidebar

Related Questions

I'm having an issue getting a LINQ query to work. I have this XML:
I have a very complex Linq to SQL query that returns a result set
I have trouble to getting my linq line to work. var result = databaseObjects.Where(dbo
I have this linq query that works well (although it may be written better,
I have this LinQ: var IPI = item.INV_TAXES.Where(t => t.TAXTYPES.TAXNAME == IPI) .Select(t =>
Hi I have this LINQ and in my DB there is a row ind
So I have this linq query clause. var ctx = new Context(); IQueryable<Users> consulta
I have this following IEnumerable LINQ query: var query = from p in Enumerable.Range(2,
I have this code in Linq. Anybody can provide the t-sql. thanks! var tsr
Can I have some help in improving this linq. I'm basically returning speakers from

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.