LLBLGen version 5.9.4 (also tried in 5.10 beta with the same results)
Adapter .NET 6 C#
DTO Class Model SQL Server 2019
SD.LLBLGen.Pro.DQE.SqlServer (5.9.4-hotfix-20230109)
SD.LLBLGen.Pro.ORMSupportClasses (5.9.4-hotfix-20230109)
I'm trying to create a Derived Element DTO for 5 entities, 4 of which participate in Target-Per-Entity hierarchies (please see attached screenshot). InvoiceBase has a subtype of Invoice, while ReceivedItem has a subtype of DamagedItem.
The Derived Element DTO output should include 3 ReceivedItems (which it does), but the first ReceivedItem object should be of type DamagedItem and include the additional subtype field (which it does not). It was selected in the LLBLGen designer, and the data exists. Additionally, the ORM Profiler confirmed that no query was executed for the subtype (see below).
I have reproduced the problem in a simple database and LLBLGen project (which I can provide if helpful). My object model is similar in structure to the "Detailed Example" in the documentation (https://www.llblgen.com/Documentation/5.9/Designer/Concepts/DerivedModels.htm).
This is the final (of 3) queries LLBLGen executed to populate the ReceivedItem -- it seems to be missing a left join to the DamagedItem table:
SELECT [LPA__1].[InvoiceItemID] AS [InvoiceItemId],
[LPA__1].[ItemID] AS [ItemId],
[LPA__1].[TestReceived]
FROM [LlblgenTest].[dbo].[ReceivedItem] [LPA__1]
WHERE (([LPA__1].[InvoiceItemID] IN (@p1, @p2, @p3)))
Code to return the DTO :
var q = qf.Invoice
.ProjectToInvoiceDto(qf);
Let me know if you need any additional details. And thanks very much for your help!
Attachments
Filename |
File size |
Added on |
Approval |
llblgenExample.png
|
57,062 |
02-Feb-2023 02:08.09 |
Approved |