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, we are using some aggregates in our model and it would be usefull if LightSpeed automatically defines constants for each aggregate. Regards, Dennis |
|
|
Hi Dennis, That sounds like a useful idea. I'm assuming the idea is that we'd generate a bunch of consts along the lines of:
nothing more sophisticated than that, just so you can get a bit of compile time checking if an aggregate name changes, right? Where do you envisage these constants being generated? They don't seem to belong in entity classes, because an aggregate could span multiple levels of an object graph, but the only other place we have to generate them at the moment is the LINQ unit of work, which doesn't feel right either. Would you envisage us generating a new class specifically for the aggregates e.g.
|
|
|
Hi, this sounds good. I think it would also make sense to define the constants as an enum:
Regards, Dennis |
|
|
We can't do that because (a) enums have to be backed by integral types, not strings and (b) Query.AggregateName / WithAggregate() are declared to take string, so a cast would be required to use an enum. I'll just do it as consts. Thanks for the feedback! |
|
|
This will be in the next nightly build. Let us know if you run into any problems or have any suggestions! |
|