Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do "select count(*)" on ADO.NET Entity Framework

How can I do a "select count(*)" using ADO.NET Entity Framework?

Thanks!

like image 388
VansFannel Avatar asked Apr 25 '26 09:04

VansFannel


1 Answers

Use the Count() LINQ operator. If you're using C#, there isn't anything in the query expression syntax to cover this, so you have to do call it with dot-notation.

like image 188
Jon Skeet Avatar answered Apr 26 '26 23:04

Jon Skeet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!