public void Test() { var repo = new TinyUrlBulkWriteRepository(new TinyUrlContext(new MongoDbConfig() { Database = "TinyUrlDB", Host = "localhost", Port = 27017, User = "******", Password = "******" })); TestContext.WriteLine("Done"); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var config = new ServerConfig(); Configuration.Bind(config); var tinyUrlContext = new TinyUrlContext(config.MongoDB); //var repo = new TinyUrlRepository(tinyUrlContext); var repo = new TinyUrlBulkWriteRepository(tinyUrlContext); services.AddSingleton <ITinyUrlRepository>(repo); services.AddSwaggerGen(c => { c.SwaggerDoc("v0.1", new Info { Title = "TinyUrl", Version = "v1" }); }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); }