Xml parse object inside of list of objects inside object using LINQ

Xml parse object inside of list of objects inside object using LINQ

<strong>XML FILE</strong>

XML FILE

<Lines>
    <LineEntity>
      <Id>33947</Id>
      <Name>SEC_137438957044</Name>
      <IsUnderground>true</IsUnderground>
      <R>0.209</R>
      <ConductorMaterial>Steel</ConductorMaterial>
      <LineType>Cable</LineType>
      <ThermalConstantHeat>2400</ThermalConstantHeat>
      <FirstEnd>41990</FirstEnd>
      <SecondEnd>41992</SecondEnd>
      <Vertices>
        <Point>
          <X>407566.68007470988</X>
          <Y>5013899.3558040857</Y>
        </Point>
        <Point>
          <X>407625.00589398207</X>
          <Y>5013876.8697334668</Y>
        </Point>
        <Point>
          <X>407717.51971015992</X>
          <Y>5014160.9525629422</Y>
        </Point>
        <Point>
          <X>407559.40091708023</X>
          <Y>5014220.4665799234</Y>
        </Point>
      </Vertices>
    </LineEntity>
</Lines>

I want to get this Vertices object with Points, but I don't know how to get to it. What I tried so far:

var lines = xdoc.Descendants("LineEntity")
                 .Select(line => new Line
    {
        Id = (double)line.Element("Id"),
        Name = (string)line.Element("Name"),
        ConductorMaterial = (string)line.Element("ConductorMaterial"),
        IsUnderground = (bool)line.Element("IsUnderground"),
        R = (decimal)line.Element("R"),
        FirstEnd = (int)line.Element("FirstEnd"),
        SecondEnd = (int)line.Element("SecondEnd"),
        LineType = (string)line.Element("LineType"),
        ThermalConstantHeat = (int)line.Element("ThermalConstantHeat"),
        Vertices = line.Descendants("Vertices").Select(p => new Point {
        X = (decimal)p. //can't access Element
    })
}).ToList();


c-sharp xml linq

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Is Using LINQ in C# Bad for Performance?

LINQ (Language INtegrated Query) is a set of features in C# for concise and declarative code. I use it pretty much wherever I can, but sometimes I wonder and people ask: is this a performance trap? It would be painful to have to replace many usages of LINQ with other constructs in addition to time spent finding that to be an actual bottleneck. Let’s do a basic benchmark to see what using LINQ might cost us compared to more traditional constructs such as for and foreach loops, and see if this worry is valid.

C. C++. C#. 차이점 알려드림. 5분 순삭. Explain C.C++.C#. Like I'm Five

C. C++. C#. 차이점 알려드림. 5분 순삭. Explain C.C++.C#. Like I'm Five. 아시죠? C는 C++.C# 줄인말이 아니라는거?

Learn how to perform CRUD operations using C Sharp

QuickStart: CRUD Operations in C Sharp. Learn how to perform CRUD operations using C Sharp for MongoDB databases.

Loops in C++ | For, While, and Do While Loops in C++

In this Video We are going to see how to use Loops in C++. We will see How to use For, While, and Do While Loops in C++.

Using isdigit() in C/C++

In this article, we'll take a look at using the isdigit() function in C/C++. This is a very simple way to check if any value is a digit or not. Let's look