Lts say i have XElement object doc:
<parameters mode="solve">
<inputs>
<a>value_a</a>
...
...
how do i get the value of the attribute of the first element (parameters), in other words how do i check which mode is it on.
if i write
if ((string)doc.Element("parameters").Attribute("mode").Value == "solve") { mode = 1; }
it gives me null object reference error