Hi all,
Please have a look at the attached...
I have a TPH inheritance : ProductType1 and ProductType2 are subtypes of Product. The discrimator field is RefType (0 for Product, 1 for ProductType1, 2 for ProductType2).
These three entities are the only ones in the LLBLGen (V3.0 Final november 15th, 2010) model.
The expected result for the second any() query on the ProductType1 entity should be false.
But it returns true!
Product.Any(p => p.Id != 10 && p.Label == "ProductName");
Executed Sql Query:
Query: SELECT TOP(@p4) CASE WHEN EXISTS (SELECT [LPLA_1].[RefType] FROM [FABI_BIOPERA].[dbo].[Product] [LPLA_1] WHERE ( ( ( [LPLA_1].[Id] <> @p1) AND ( [LPLA_1].[Label] = @p2)))) THEN 1 ELSE 0 END AS [LPFA_1] FROM [FABI_BIOPERA].[dbo].[Product] [LPLA_1]
Parameter: @p1 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 10.
Parameter: @p2 : String. Length: 50. Precision: 0. Scale: 0. Direction: Input. Value: "ProductName".
Parameter: @p4 : Int64. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 1.
ProductType1.Any(p => p.Id != 10 && p.Label == "ProductName");
Executed Sql Query:
Query: SELECT TOP(@p4) CASE WHEN EXISTS (SELECT [LPLA_1].[RefType] FROM [FABI_BIOPERA].[dbo].[Product] [LPLA_1] WHERE ( ( ( [LPLA_1].[Id] <> @p1) AND ( [LPLA_1].[Label] = @p2)))) THEN 1 ELSE 0 END AS [LPFA_1] FROM [FABI_BIOPERA].[dbo].[Product] [LPLA_1] WHERE ( ( ( [LPLA_1].[RefType] = @p5 OR [LPLA_1].[RefType] IS NULL)))
Parameter: @p1 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 10.
Parameter: @p2 : String. Length: 50. Precision: 0. Scale: 0. Direction: Input. Value: "ProductName".
Parameter: @p4 : Int64. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 1.
Parameter: @p5 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 1.
Attachments
Filename |
File size |
Added on |
Approval |
Any-TPH.png
|
89,373 |
16-Nov-2011 15:53.52 |
Approved |