public void Update(Block block) { Block _block = dbCon.Blocks.SingleOrDefault(x => x.Id == block.Id); if (_block != null) { _block.status = block.status; _block.Name = block.Name; _block.Content = block.Content; dbCon.SaveChanges(); } }
public ActionResult Create(BlockViewModel model) { if(ModelState.IsValid) { Block block = new Block(); block.Name = model.Name; block.Content = model.Content; block.status = model.status? 1:0; _blockService.Create(block); return RedirectToAction("Index"); } return View(model); }
public void Update(Block block) { _blockRepository.Update(block); }
public void Delete(Block block) { _blockRepository.Delete(block); }
public void Create(Block block) { _blockRepository.Create(block); }
public void Delete(Block block) { dbCon.Blocks.Remove(block); dbCon.SaveChanges(); }
public void Create(Block block) { dbCon.Blocks.Add(block); dbCon.SaveChanges(); }