Configuration Files: how to read them into models?

Posted by stacker on Stack Overflow See other posts from Stack Overflow or by stacker
Published on 2010-05-04T21:58:03Z Indexed on 2010/05/04 22:08 UTC
Read the original article Hit count: 410

I have a lot of configuration files in this format:

<?xml version="1.0" encoding="utf-8"?>
<XConfiguration>
  <XFile Name="file name 1" />
  <XFile Name="name2" />
  <XFile Name="name3" />
  <XFile Name="name4" />
</XConfiguration>

I want to use ConfigurationRepository.Get to get this object populated:

public class XConfiguration
{
    public XFile[] Files { get; set; }
}

I wonder what is the best way to do that. LinqToXml? I don't think ConfigurationManager is a smart option for this.

© Stack Overflow or respective owner

Related posts about c#

Related posts about configuration