public IActionResult MyAccount(int id) { Adsdb db = new Adsdb(_connection); int userId = db.GetIdByEmail(User.Identity.Name); return(View(db.GetAds(userId))); }
public IActionResult Index() { Adsdb db = new Adsdb(_connection); AdView view = new AdView(); bool IsLoggedIn = User.Identity.IsAuthenticated; if (IsLoggedIn) { string email = User.Identity.Name; view.Id = db.GetIdByEmail(email); } view.Ads = db.GetAds(); return(View(view)); }