/// <summary> /// Registers types /// </summary> /// <returns>ready set up container</returns> private static IUnityContainer ContainerSetup() { IUnityContainer container = new UnityContainer(); string engine = ConfigurationManager.AppSettings["DbEngine"]; switch (engine) { case "MongoDB": container.RegisterType <IWebNoteRepository, MongoDbRepositoryLinq>() .RegisterInstance(typeof(DatabaseStartScript), DatabaseStartScript.ForMongoDb()); break; case "Redis": container.RegisterType <IWebNoteRepository, RedisRepository>() .RegisterInstance(typeof(DatabaseStartScript), DatabaseStartScript.ForRedis()); break; case "RavenDB": container.RegisterType <IWebNoteRepository, RavenDbRepository>() .RegisterInstance(typeof(DatabaseStartScript), DatabaseStartScript.ForRavenDb()); break; default: container.RegisterType <IWebNoteRepository, EntityFrameworkRepository>() .RegisterInstance(typeof(DatabaseStartScript), DatabaseStartScript.ForSqlServer()); break; } container.RegisterType <DatabaseStartScript>(); return(container); }
public void StartAndInitialize() { string importScript = DatabaseStartScript.GetCurrentExecutingDirectory() + @"\..\..\ExplorativeTests\MongoDb\import_logs.cmd"; Process.Start(new ProcessStartInfo(importScript)); var client = new MongoClient(ConnectionString); server = client.GetServer(); database = server.GetDatabase(DatabaseName); }
public ExploratoryTest(DatabaseStartScript script) { this.script = script; }
// Fire up the server! public HowToConnectAndUseMongoDb() : base(DatabaseStartScript.ForMongoDb()) { }
public HowToConnectAndUseRavenDb() : base(DatabaseStartScript.ForRavenDb()) { }
public HowToUseRedisAsCache() : base(DatabaseStartScript.ForRedis()) { }
// Fire up the server! public HowToMapReduceWithMongoDb() : base(DatabaseStartScript.ForMongoDb()) { }
public HowToConnectAndUseRedis() : base(DatabaseStartScript.ForRedis()) { }
public HowToMapReduceWithRavenDb() : base(DatabaseStartScript.ForRavenDb()) { }
// Fire up the server! public HowToReadAndWriteWithMongoDb() : base(DatabaseStartScript.ForMongoDb()) { }