/// <summary>
 /// Be careful! this method can act as save or update. So if you just
 /// want to save, make sure you have used contains() method before.
 /// </summary>
 /// <param name="vo"></param>
 public void save(GlassRecipeVo vo)
 {
     // check exists
     powderRepository.save(toPowder(vo));
     grRepository.save(toGlassRecipe(vo));
 }
예제 #2
0
        public void testSave()
        {
            repository.deleteAll();
            repository.save(new Powder("a"));
            repository.save(new Powder("a")); // skip cu'z name duplicated
            Assert.AreEqual(1, repository.count());

            repository.save(new Powder("b"));
            Assert.AreEqual(2, repository.count());

            repository.deleteAll();
            repository.save(new Powder("a"));
            int id = repository.findByPowderName("a").get().Id;

            repository.save(new Powder(id, "b"));

            Assert.AreEqual(1, repository.count());
        }
예제 #3
0
 public void addPowder(Powder powder)
 {
     powderRepository.save(powder);
     PowdersUpdated();
 }