I believe that using the PersisitnceModel.WritemappingsTo yields
diferent results than the XML that is acutally used if you don't write
the mapings though. By different, I mean the order of the properties
are different. So as long as you are not concerned about what order
the properties come in then it should be fine. The other way is to do
something like this:
Use an IMappingVisitor to do this:
// This code is the caller to write the files
IList<IMapGenerator> mappers = GeneratorHelper.GetMapGenerators();
foreach (var mapper in mappers)
{
mapper.Generate().Save(mapper.FileName);
}
Each map I want to write out implements IMapGenerator
public XmlDocument Generate()
{
return CreateMapping(new MappingVisitor());
}
IMapGenerator code:
public interface IMapGenerator
{
string FileName { get; }
XmlDocument Generate();
}
On Jan 8, 10:05 am, "James Gregory" <
jagregory....@gmail.com> wrote:
> As Andrew said, the PersistenceModel has a WriteMappingsTo(string folder)method.
>
> On Thu, Jan 8, 2009 at 4:03 PM, Mart Leet <
mal...@gmail.com> wrote:
> > To see my xml in testexplorer i created this:Console.Write(XElement.Parse(CreateMapping(new
> > MappingVisitor()).FirstChild.NextSibling.InnerXml,
> > LoadOptions.PreserveWhitespace).ToString());
>
> > Not much, but readable...
>