예제 #1
0
        public void MapTest2()
        {
            List <int> list = new List <int> {
                1, 2, 3
            };
            List <int> mapList = MapClass <int> .Map(list, x => x *x);

            Assert.IsTrue(mapList[0] == 1 && mapList[1] == 4 && mapList[2] == 9);
        }
예제 #2
0
        public void MapTest3()
        {
            List <int> list = new List <int> {
                5
            };
            List <int> mapList = MapClass <int> .Map(list, x => x + x);

            Assert.IsTrue(mapList[0] == 10);
        }
예제 #3
0
        public void MapTest1()
        {
            List <int> list = MapClass.Map(new List <int>(3)
            {
                1
            }, x => x + x);

            Assert.IsTrue(list.Exists(x => x == 2));
        }
        public static void AddMongoService(this IServiceCollection services, IConfiguration Configuration)
        {
            services.Configure <ProductManagementDatabaseSettings>(Configuration.GetSection(nameof(ProductManagementDatabaseSettings)));

            services.AddSingleton <IProductManagementDatabaseSettings>(sp => sp.GetRequiredService <IOptions <ProductManagementDatabaseSettings> >().Value);

            services.AddScoped <IProductRepository, ProductRepository>();

            services.AddScoped <IDbContext, DbContext>();

            MapClass.Map();
        }