public ViewResult Edit(Blog b, int blogid)
        {
            string      name    = HttpContext.Session.GetString("Name");
            int         id      = PublicUserRepo.GetId(name);
            List <Blog> myBlogs = BlogRepo.getMyBlogs(id);

            if (ModelState.IsValid)
            {
                foreach (Blog bl in myBlogs)
                {
                    if (bl.blog_Id == b.blog_Id)
                    {
                        bl.Title   = b.Title;
                        bl.Content = b.Content;
                        bl.Date    = b.Date;
                        BlogRepo.RemoveBlog(bl.blog_Id);
                        BlogRepo.AddBlog(b, id); //Sath hi database ma b update kr dia h
                        break;
                    }
                }

                return(View("ViewMyBlogs", myBlogs));
            }
            else
            {
                ModelState.AddModelError(String.Empty, "Please enter correct data");
                return(View());
            }
        }
        public ViewResult Remove(int id)
        {
            BlogRepo.RemoveBlog(id);
            PublicUserRepo.RemoveById(id);
            List <PublicUser> users = PublicUserRepo.GetAllUsers();

            return(View("AdminDash", users));
        }
        public ViewResult Remove(int id)
        {
            BlogRepo.RemoveBlog(id);
            string      name  = HttpContext.Session.GetString("Name");
            int         myid  = PublicUserRepo.GetId(name);
            List <Blog> blogs = BlogRepo.getMyBlogs(myid);

            return(View("ViewMyBlogs", blogs));
        }