S
shapper
Hello,
I am creating a node in a XML file as follows:
private XDocument _context;
_context = XDocument.Load(String.Concat(path, "Slides.xml"),
LoadOptions.SetBaseUri);
// ...
XElement _slide = new XElement("Slide",
new XElement("Id", ???),
new XElement("Name", slide.Name),
new XElement("Published", slide.Published.ToString()),
new XElement("Url", slide.Url)
);
_context.Root.Add(_slide);
_context.Save(new Uri(_context.BaseUri).LocalPath);
I would like the Id to be an incremental unique INT (identity) like as
I use it SQL database.
What is the best way to get the id to be used?
(I am using Linq to ...)
Thanks,
Miguel
I am creating a node in a XML file as follows:
private XDocument _context;
_context = XDocument.Load(String.Concat(path, "Slides.xml"),
LoadOptions.SetBaseUri);
// ...
XElement _slide = new XElement("Slide",
new XElement("Id", ???),
new XElement("Name", slide.Name),
new XElement("Published", slide.Published.ToString()),
new XElement("Url", slide.Url)
);
_context.Root.Add(_slide);
_context.Save(new Uri(_context.BaseUri).LocalPath);
I would like the Id to be an incremental unique INT (identity) like as
I use it SQL database.
What is the best way to get the id to be used?
(I am using Linq to ...)
Thanks,
Miguel