public void Read_Configuration_Values() { var info = ORMConfiguration.GetInfo(); Assert.IsNotNull(info); Assert.IsNotNull(info.Parser); Assert.AreEqual(true, info.Parser.ComplexTags); Assert.IsNotNull(info.DataEngine); Assert.AreEqual(true, info.DataEngine.RelaxTransformers); Assert.IsNotNull(info.DataLink); Assert.AreEqual("KeroseneDB", info.DataLink.ConnectionString); Assert.AreEqual(5, info.DataLink.Retries); Assert.AreEqual(30, info.DataLink.RetryInterval); Assert.IsNotNull(info.CustomEngines); Assert.AreEqual(1, info.CustomEngines.Count); var engine = info.CustomEngines.Items.FirstOrDefault(); Assert.IsNotNull(engine); Assert.AreEqual("MyUniqueId", engine.Id); Assert.AreEqual("Kerosene.ORM.Core.Concrete.DataEngine", engine.TypeName); Assert.AreEqual("Kerosene.ORM.dll", engine.AssemblyName); Assert.AreEqual("AnInvariantName", engine.InvariantName); Assert.AreEqual("1.2.3", engine.ServerVersion); Assert.AreEqual(true, engine.CaseSensitiveNames); Assert.AreEqual("p", engine.ParameterPrefix); Assert.AreEqual(true, engine.PositionalParameters); Assert.AreEqual(true, engine.SupportsNativeSkipTake); }
internal void Register() { var containerBuilder = new ContainerBuilder(); ORMConfiguration section = (ORMConfiguration)ConfigurationManager.GetSection("orm"); containerBuilder.Register(x => new SQLServerManager(section)).As <IDataSourceManager>().SingleInstance(); containerBuilder.RegisterType <SQLServerQueryBuilder>().As <IQueryBuilder>(); containerBuilder.RegisterType <LogManager>().As <LogManager>(); Container = containerBuilder.Build(); Container.BeginLifetimeScope(); }
public void Read_Configuration_Values() { var info = ORMConfiguration.GetInfo(); Assert.IsNotNull(info); Assert.IsNotNull(info.DataMap); Assert.AreEqual(true, info.DataMap.EnableCollector); Assert.AreEqual(true, info.DataMap.EnableCollectorGC); Assert.AreEqual(5000, info.DataMap.CollectorInterval); Assert.AreEqual(true, info.DataMap.EnableWeakMaps); Assert.AreEqual(true, info.DataMap.TrackEntities); Assert.AreEqual(true, info.DataMap.TrackChildEntities); }
public SQLServerManager(ORMConfiguration config) { // TODO: Resolve using DI _sqlHelper = new SQLHelper(config.ConnectionString); }