HOW TO INDEX VIEW RECORD INFORMATION ONLY CURRENT USER

Anupam Mishra

Total Post:135

Points:949
Posted by  Anupam Mishra
 559  View(s)
Ratings:
Rate this:
Hi,

i have already code  in index view recorded only information about current user . My code is below:

 var req = db.permit.Include(e => e.User).Where(m => m.UserId == User.Identity.GetUserId());
        return View(req);
But it's not work. can anyone give me a solution.

Thank  you.
  1. Sachin Singh

    Post:26

    Points:182
    Re: How to index view record information only current user

    Hi Anupam,


    If you are use this code, i think your problem probably be solved:

    string userID = User.Identity.GetUserId();
    var req = db.permit.Include(e => e.User).Where(m => m.UserId == userID);
    return View(req);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!