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();

}


Get Free Email Updates!

Signup now and receive free offers, discounts & coupon codes

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge