Closed oliverreid closed 8 years ago
I can't reproduce this. I'm wondering if it might be a decoration issue, because if I use the following definitions it works fine:
[Table("[test].[A]")]
public class A
{
[PrimaryKey]
public int AKey {get; set;}
}
public class B : A
{
}
[Table("[test].[C]")]
public class C
{
[PrimaryKey]
public int? CKey { get; set; }
[Column("BKey")]
[ManyToOne]
public B Bobject { get; set; }
}
Against these DAOs the following query:
var results = connection.AutoQuery<C, B>(new { CKey = 1 });
Generates this SQL:
SELECT [ta0_c].[CKey],
[ta1_b].[AKey]
FROM [test].[C] AS ta0_c
LEFT OUTER JOIN [test].[A] AS ta1_b
ON ta1_b.[AKey] = ta0_c.[BKey]
WHERE ta0_c.[CKey] = @CKey
;
The SplitOn
property contains an array with a single element, "AKey"
, which is what I'd expect to see, based on the DAO definitions.
Closing for now but will reopen if we find a scenario where it's still live.
Boject is not loaded when autoQuerying class C