Example #1
0
        public void testSaveAll()
        {
            repository.deleteAll();
            List <Powder> list = new List <Powder>();

            list.Add(new Powder("a"));
            list.Add(new Powder("b"));
            list.Add(new Powder("c"));
            repository.saveAll(list);

            Assert.AreEqual(3, repository.count());
        }
        public void saveAll(List <GlassRecipeVo> vos)
        {
            List <GlassRecipe> grs     = new List <GlassRecipe>();
            List <Powder>      powders = new List <Powder>();

            // should save powder first to generate powder id
            vos.ForEach(vo => powders.Add(toPowder(vo)));
            powderRepository.saveAll(powders);

            // here would use powder id generated above
            vos.ForEach(vo => grs.Add(toGlassRecipe(vo)));
            grRepository.saveAll(grs);
        }