I am looking for a nice way to save / load the following. I want to save as XML and ideally looking to use LiNQ (namely to help me learn LINQ)
I don't know how to do nested linq writes though. Can anyone help?
/// <summary>
///
/// </summary>
public class ErrorType
{
List<ErrorType> _childErrors;
public String Name { get; set; }
public bool Ignore { get; set; }
public List<ErrorType> ChildErrors { get; protected set; }
}
/// <summary>
///
/// </summary>
public class ErrorList
{
public List<ErrorType> ChildErrors { get; protected set; }
public void Save()
{
}
public void Load()
{
}
}
Essentially the ErrorList contains a top level list of Errors, each error can have children. The XML output should look something like:
<ErrorList>
<ErrorName1 Ignore="false">
<ChildErrorName1 Ignore="true">
<ChildErrorName2 Ignore="false" />
</ChildErrorName1>
</ErrorName1>
<ErrorList>
If anyone could help that would be great. Thanks