public IContext GetContext() { if (context == null) { ILoggingService loggingService = engine.GetService <ILoggingService>(); if (loggingService != null) { loggingService.LogInfo(this, "Creating NPersist context"); } IConfigurationService configurationService = engine.GetService <IConfigurationService>(); string path = configurationService.SchemaFilePath; IMapSerializer serialier = new DefaultMapSerializer(); IDomainMap domainMap = DomainMap.Load(path, serialier, false, false); context = new Context(domainMap); GenerateAssembly(context); context.SetConnectionString(configurationService.ConnectionString); context.AutoTransactions = false; } return(context); }
private IContext GetContext(string mapPath) { IMapSerializer serialier = new DefaultMapSerializer(); IDomainMap domainMap = DomainMap.Load(mapPath, serialier, false, false); IContext context = new Context(domainMap); GenerateAssembly(context); return(context); }
private IContext GetContext() { //Assembly asm = this.GetType().Assembly; //string path = "Puzzle.FastForward.Web.Test.npersist"; string path = @"C:\Berlioz\Puzzle\FastForward\Puzzle.FastForward.Web\Test.npersist"; IMapSerializer serialier = new DefaultMapSerializer(); IDomainMap domainMap = DomainMap.Load(path, serialier, false, false); IContext context = new Context(domainMap); GenerateAssembly(context); return(context); }
public IDomainMap GetDomainMap() { if (domainMap == null) { ILoggingService loggingService = engine.GetService <ILoggingService>(); if (loggingService != null) { loggingService.LogInfo(this, "Loading NPersist mapping file."); } IConfigurationService configurationService = engine.GetService <IConfigurationService>(); IMapSerializer serializer = new DefaultMapSerializer(); this.domainMap = DomainMap.Load(configurationService.SchemaFilePath, serializer, false, false); } return(this.domainMap); }
public static void Convert(string sourceFileName, string targetFileName, IMapSerializer sourceMapSerializer, IMapSerializer targetMapSerializer) { IDomainMap domainMap = DomainMap.Load(sourceFileName, sourceMapSerializer); domainMap.Save(targetFileName, targetMapSerializer); }