public static IGenerationSessionFactory Configure(Action<IEngineConfigurationBuilder> setup) { var config = new EngineConfigurationBuilder(); config.Conventions(x => x.Register<DefaultPrimitiveCtorConvention>()); setup.Invoke(config); var configFactory = new EngineConfigurationFactory(); return new GenerationSessionFactory(configFactory.Create(config, config.ConventionProvider), config.ConventionProvider); }
public static IGenerationSessionFactory Configure(Action <IEngineConfigurationBuilder> setup) { var config = new EngineConfigurationBuilder(); config.Conventions(x => x.Register <DefaultPrimitiveCtorConvention>()); setup.Invoke(config); var configFactory = new EngineConfigurationFactory(); return(new GenerationSessionFactory(configFactory.Create(config, config.ConventionProvider), config.ConventionProvider)); }
public static IGenerationSession CreateDefaultSession() { var config = new EngineConfigurationBuilder(); var configFactory = new EngineConfigurationFactory(); config.Conventions(x => x.UseDefaultConventions()); return new GenerationSessionFactory( configFactory.Create(config, config.ConventionProvider), config.ConventionProvider) .CreateSession(); }
public void Conventions_InvokesAction() { EngineConfigurationBuilder config = new EngineConfigurationBuilder(); bool wasInvoked = false; config.Conventions(x => { wasInvoked = true; }); Assert.IsTrue(wasInvoked); }
public static IGenerationSession CreateDefaultSession() { var config = new EngineConfigurationBuilder(); var configFactory = new EngineConfigurationFactory(); config.Conventions(x => x.UseDefaultConventions()); return(new GenerationSessionFactory( configFactory.Create(config, config.ConventionProvider), config.ConventionProvider) .CreateSession()); }
public void Conventions_InvokesAction() { EngineConfigurationBuilder config = new EngineConfigurationBuilder(); bool wasInvoked = false; config.Conventions(x => { wasInvoked = true; }); Assert.IsTrue(wasInvoked); }