Mindscape
  • Register
  • Login
  • YOUR CART IS EMPTY
home
Software
  • Developers Toolbox
  • LightSpeed
  • Raygun
  • WPF Elements
  • Web Workbench
  • Metro Elements
  • Silverlight Elements
  • NHibernate Designer
  • Phone Elements
  • WPF Diagrams
  • Simple DB management
  • Visual Tools for SharePoint
Downloads
Store
  • Buy online
  • Purchase order
  • Volume discounts
  • Reseller
  • Software license
  • Contact sales
Blog
Support
About
  • About Us
  • Contact
  • Testimonials
rss
twitter
facebook
Performance and Tuning Controlling How Entities Load Controlling How Entity Data Loads Intercepting Queries Miscellaneous Performance and Tuning Improvements Understanding Named Aggregates Bulk Updates and Deletes Batching Caching Database Hints Measuring Performance

Understanding Named Aggregates

Associations and fields have different default behaviours, and it is possible to get confused about how aggregates and the WithAggregate operator affect the loading of fields.  This section summarises load behaviour so you can understand exactly what gets loaded and when under different circumstances.

·         If you don’t do anything to a field, it will always be loaded when the entity loads.

·         If you specify one or more aggregate names on a field, it will be loaded only when it is accessed, incurring a separate database access, unless you specify one of those aggregates in your query.

·         If you don’t do anything to an association, it will be loaded only on demand, incurring a separate database access.

·         If you specify eager load on an association, it will always be loaded when the entity loads, as part of the same database access.

·         If you specify one or more aggregate names on an association (and don’t specify eager load), it will be loaded only on demand, unless you specify one of those aggregates in your query, in which case it will be loaded when the entity loads, like an eager load association.

·         WithAggregate doesn’t affect fields or associations that aren’t part of a named aggregate.  They will stay eager or lazy depending on how they were set up.

·         WithAggregate propagates across associations, so you can use a named aggregate to load an entire object graph.

·         You can specify multiple named aggregates on a field or association to control which subsets of entity data and/or the object graph get loaded in different situations.

Visualising Aggregates

You can use the designer to help you visualise named aggregates.  See Custom Views in the chapter Working with Models in the Visual Designer.

Data Products

  • LightSpeed ORM
  • NHibernate Designer
  • SimpleDB Tools
  • SharePoint Tools

DevOp Tools

  • Raygun

Visual Controls

  • WPF Elements
  • WPF Diagrams
  • Silverlight Elements
  • Phone Elements

Popular Products

  • Web Workbench

    Modern web development for Visual Studio!

  • Mindscape Megapack

    All Mindscape products for one awesome price!

Quick Links

  • Forums
  • Blog
  • Register
  • Login
  • Contact us
  • Twitter
  • Facebook
  • Google+
  • YouTube
  • Linkedin
  • Rss

© Mindscape 2025. Mindscape is a registered trademark of Mindscape Limited.

  • Terms
  • Privacy