/// <summary>
 /// Removes the specified entity.
 /// </summary>
 /// <param name="entity">The entity.</param>
 public void Remove(Post entity)
 {
     lock (_context)
     {
         _context.Entry(entity).State = EntityState.Deleted;
     }
 }
 /// <summary>
 /// Adds the specified entity.
 /// </summary>
 /// <param name="entity">The entity.</param>
 public void Add(Post entity)
 {
     lock (_context)
     {
         _context.Entry(entity).State = EntityState.Added;
     }
 }
 /// <summary>
 /// Updates the specified entity.
 /// </summary>
 /// <param name="entity">The entity.</param>
 public void Update(Post entity)
 {
     lock (_context)
     {
         _context.Entry(entity).State = EntityState.Modified;
     }
 }
 public ActionResult Remove(Post post)
 {
     if (ModelState.IsValid)
     {
         _unitOfWork.Posts.Remove(post);
         _unitOfWork.Save();
         return RedirectToAction("Posts");
     }
     return HttpNotFound();
 }