This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, Is there a way to specify more than one named aggregate? The reason I ask, I have in some base classes some field groups that need to get picked up in certain situtations from the UI level. They are already named and inherited by many classes. In the current implementation I must redecorate the base class with more eager load paths for each derived class. Instead if it were possible to due a query with more than one named aggregate, the secondary decorations would not be needed. If it were possible to either name more then one named aggregate at the query level or to maybe chain EagerLoad attributes, both would work. The chaining could be implemented by adding an additional property to the EagerLoad attribute that would contain the name of the second aggregate. But being able to name multiple aggregates at the query level would definetly be the most powerful approach. Thanks again, Kavan |
|
|
Hi Kavan, Currently, you can apply the eager load attribute multiple times to the same field. I will add specifying multiple aggregates at the query level to the backlog. Cheers, Andrew. |
|
|
With 2.2, can we supply multiple named aggregates at the query level? Here's an example of what I am trying to accomplish. Customer contains multiple Orders and multiple Addresses. Orders contain multiple Order Lines. I've been able to successfully use a Named Aggregate to Eager Load the Orders when I load customers, but the other collections still Lazy Load. I need to have the option, though, to Eager Load Addresses and Order Lines with Named Aggregates. The bottom line of what I am trying to accomplish is to Eager or Lazy load programmatically.
|
|
|
Hi bflecht, Currently you specify a single AggregateName as part of the query (or by using the WithAggregate extension when using LINQ), however there is no support for multiple aggregate names on the query. However you can decorate your fields and associations with any number of named aggregates to build up various load strategies. Let us know if you are having any issues in getting this working for you :) A small example model always helps for this :)
Jeremy |
|
|
I am just starting to evaluate LightSpeed, so please forgive me if I am mistake in my assumptions. Actually, I can see value in supporting two additional capabilities if possible. 1. Being able to specify aggregates many levels deep. 2. Being able to specify multiple aggregates from the root.The first might be achieved by adding a WithAggregates extension method that takes a params string[] argument. This would allow us to specify a chain of aggregate names that drill through many relations.
For example, lets say I have a Customers table, Orders table, OrderItems table and a CustomerShippingAddress table and I would like to eager load all of these entities. I could write something like the following: Of course, since the new WithAggregates extension method would is a does everything that the WithAggregate extension does and more, you could also write this as: var customer = uow.Customers I have seen this idea of specifying multiple span relations as part the query in other ORM frameworks and see real value in it. Just my two cents, Neal Borelli |
|
|
OK, I get it now, I guess I was just working too late last night. I now understand the full purpose of supporting multiple named aggregates. It is just a different approach than I have seen before. The aggregates allow us to store any number of different eager loading sets as part of the model. This makes for much simpler LINQ queries and allows us to tune the eager loading in the model designer. I have to play with is some more, but it makes a lot of sense so far. Please disregard my e-mail post from last night. I just need to look at it with fresh eyes. -Neal |
|
|
I just asked the same question here http://www.mindscape.co.nz/forums/Thread.aspx?ThreadID=1679 since you did not get a response. I also want to eagerload multi levels deep. Joe |
|