Skip to content

URmy.Net

My Tips, Tricks and References

Skip to content
  • About Matt Lyons

Entity Framework Count Related Entities Without Loading

Published on December 31, 2010January 21, 2015 by matt

I ran across this post on Stack Overflow. Here is the code I ended up using:

Dim count = (From x In db.Orders Where x.OrderID = orderID From y In x.OrderDetails Select y).Count

Article Information

Last Modified on January 21, 2015
This entry was posted in ASP.Net, Entity Framework, SQL Server
Bookmark this article Entity Framework Count Related Entities Without Loading

Post navigation

More Articles

How to Hash Passwords for XML Files
Grant Alter Trace Permission SQL Server Profiler
  • About Matt Lyons

Recent Posts

  • WordPress
  • Banner Ads Statistics
  • Line Breaks in ConfirmButtonExtender
  • ASP.NET 4.0 Custom Error Pages Very Slow to Load
  • Google’s search results algorithm Panda

My Other Sites

  • Lyons Communicaitons, LLC
  • Email Login

Categories

  • AJAX
  • ASP.Net
  • Browser
  • C#
  • Classic ASP
  • CSS
  • Entity Framework
  • Facebook
  • HTML
  • JavaScript
  • jQuery
  • Mobile
  • Network
  • Other
  • PHP
  • SEO
  • Server Setup
  • SQL Server
  • SSL/TLS
  • Visual Basic
  • WordPress

Archives

  • January 2015
  • March 2013
  • September 2012
  • January 2012
  • November 2011
  • September 2011
  • August 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • October 2010
  • May 2010
  • March 2010
  • February 2010
  • December 2009
  • June 2009
  • November 2008
  • June 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • November 2007
  • October 2007
  • August 2007
  • July 2007
  • May 2007
  • April 2007
  • March 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • May 2005

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright © 2025 Your Name. All rights reserved.