コード例 #1
0
 public void CreateCategory(CategoryEdit category)
 {
     Mapper.CreateMap<CategoryEdit, Category>();
     Db.Categories.Create(Mapper.Map<CategoryEdit, Category>(category));
 }
コード例 #2
0
 public void EditCategory(CategoryEdit category)
 {
     var existedCategory = Db.Categories.GetByID(category.CategoryId);
     existedCategory.Name = category.Name;
     existedCategory.IconName = category.IconName;
     existedCategory.BackgroundImgName = category.BackgroundImgName;
     existedCategory.HomeImgName = category.HomeImgName;
     Db.Categories.Update(existedCategory);
 }