Example #1
0
        public IActionResult Comment(BinhLuan binhLuan)
        {
            if (ModelState.IsValid)
            {
                binhLuan.ThoiGian = DateTime.Now;
                context.BinhLuan.Add(binhLuan);
                context.SaveChanges();
            }
            var baiBao = context.BaiBao.Find(binhLuan.IdBaiBao);

            return(RedirectToAction(nameof(Index), new { id = binhLuan.IdBaiBao, name = baiBao?.TieuDe.ToUrlFriendly() }));
        }
Example #2
0
 public void Add(BinhLuan entity)
 {
     context.BinhLuan.Add(entity);
     context.SaveChanges();
 }
 public void Add(QuanTriVien entity)
 {
     context.QuanTriVien.Add(entity);
     context.SaveChanges();
 }
Example #4
0
 public void Add(BaiBao entity)
 {
     context.BaiBao.Add(entity);
     context.SaveChanges();
 }
 public void Add(DanhMuc entity)
 {
     context.DanhMuc.Add(entity);
     context.SaveChanges();
 }