S
shapper
Hello,
I am trying to get the maximum Id value from all Asset nodes in a XML
file:
private XDocument _assets;
// ...
Int32 id = _assets.Root.Elements("Asset").Max(s => Int32.Parse
(s.Element("Id").Value));
I am not sure if this is the best way to do it.
And how can I define a default value 1 if there are no nodes Asset in
the file?
Thanks,
Miguel
I am trying to get the maximum Id value from all Asset nodes in a XML
file:
private XDocument _assets;
// ...
Int32 id = _assets.Root.Elements("Asset").Max(s => Int32.Parse
(s.Element("Id").Value));
I am not sure if this is the best way to do it.
And how can I define a default value 1 if there are no nodes Asset in
the file?
Thanks,
Miguel