Hi there
(LLBLGen 2.5, could upgrade to 2.6)
I have a simple shop solution that consists of the following entities:
- ProductEntity
- OrderEntity
- OrderedProductEntity
...accordingly, there is an m:n relation between products and orders through the OrderedProduct entity.
I need to aggregate order data from a product's perspective in order to do some simple analysis. For this, I created a simple TypedList, that provides the following information:
- ProductId (GROUPBY)
- OrderStatus (GROUPBY)
- Total ordered products: SUM(OrderedProduct.Quantity)
Accordingly, for each product, I get the number of ordered items, grouped by the order status (paid / still open), e.g:
Lenovo_T61 / Paid / 15 pieces
Lenovo_T61 / UnPaid / 7 pieces
Lenovo_X30 / Paid / 12pieces
Lenovo_X30 / UnPaid / 7pieces
...
What's missing is a link to my product entites:
- I have an EntityCollection<ProductEntity> that was created on dynamic filters (e.g. get all Lenove notebooks)
- Foreach product, I would like to get the aggregated data of my typed list
...of course, I could do the plumbing manually, but I have the feeling that there should be an easier way, as LLBLGen does know that there is a relation between my product entities and the TypedList. Any hints?
Thanks for your advice
Philipp