How to set index with one line of LINQ? RRS feed

  • Question

  • User-1188570427 posted

    I need to get the inner text and then what index it is in the list.

    Is there a way to do this inline without me having to foreach over the list and setting it?

         var teamNameOrder = doc.DocumentNode.SelectNodes(string.Format("//*[contains(@class,'{0}')]", "hide-mobile")).Select(s => new { InnerText = s.InnerText, Index = 0 }).ToList();

    Friday, March 30, 2018 2:38 AM

All replies

  • User1120430333 posted

    And this is an ORM issue how?

    Maybe, the below forum is more suited for your inquiry.


    Friday, March 30, 2018 9:18 PM