Get Record Count using LINQ to Entities
using (var context = new MyEntities())
{
int count = (from t1 in context.table1
where t1.user_id == userID
select t1).Count();
}
using (var context = new MyEntities())
{
int count = (from t1 in context.table1
where t1.user_id == userID
select t1).Count();
}