Reputation: 467
I have this code that returns 0
var currentUser = User.Identity.GetUserId();
var businesses = db.Businesses.Where(num => num.BusinessEmail == currentUser);
ViewBag.CurrCount = businesses.Count();
And this code that returns 7
var businesses = db.Businesses.Where(num => num.BusinessEmail == "[email protected]");
ViewBag.CurrCount = businesses.Count();
[email protected] is User.Identity.GetUserId();
Any ideas?
Upvotes: 0
Views: 78
Reputation: 467
var currentUser = User.Identity.Name;
I was a little tired last night!
Upvotes: 1