private HbmMapping GetMapping() { var domainMapper = new DefaultDomainMapper(); // un-comment the follow line and comment the previous to run the demo with a different mapper //var domainMapper = new CoolDomainMapper(); var entities = new List <Type>(); entities.AddRange(ModuleMappingUtil.RunModuleMapping <NaturalnessModuleMapping>(domainMapper.DomainDefinition, domainMapper.Mapper)); return(domainMapper.Mapper.CompileMappingFor(entities)); }
public void ShowSingleXmlMappingWithDearDbaAppliers() { var domainMapper = new DearDbaDomainMapper(); var entities = new List <Type>(); entities.AddRange(ModuleMappingUtil.RunModuleMapping <NaturalnessModuleMapping>(domainMapper.DomainDefinition, domainMapper.Mapper)); var document = Serialize(domainMapper.Mapper.CompileMappingFor(entities)); File.WriteAllText("MyMapping.hbm.xml", document); Console.Write(document); }
public void WriteAllXmlMapping() { var domainMapper = new DefaultDomainMapper(); var entities = new List <Type>(); entities.AddRange(ModuleMappingUtil.RunModuleMapping <NaturalnessModuleMapping>(domainMapper.DomainDefinition, domainMapper.Mapper)); var mappings = domainMapper.Mapper.CompileMappingForEach(entities); foreach (var hbmMapping in mappings) { var fileName = GetFileName(hbmMapping); var document = Serialize(hbmMapping); File.WriteAllText(fileName, document); } }