예제 #1
0
        public void Update(M.Category model)
        {
            var item = _categoryRepo.GetById(model.ID);

            item.Name = model.Name;
            _categoryRepo.Update(item);
            UnitOfWork.SaveChanges();
        }
예제 #2
0
        public M.Category Create(M.Category model)
        {
            var category = new DB.Category()
            {
                Name = model.Name
            };

            _categoryRepo.Create(category);

            UnitOfWork.SaveChanges();

            model.ID = category.ID;

            return(model);
        }