how can I get the count of records in the table users in the applicationContextcreatedin the mvc project?
this is what I have tried so far:
var context = new ApplicationDbContext();
var count = context.Users
.Where(o => Convert.ToInt32(o.Id) == 1)
.Count();
if (count < 3)
{
//do whatever
}
it's giving an error at the convert.ToInt32, and if I remove the convert it will give an error cannot implicity convert type 'string' to 'int' (o.Id) == 1)
what is going wrong?