-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
Please note this applies to the modern branch.
Minimal example based on the Northwind tests. This leads to the association between the tables being lost and so the resultant SQL lacks the where exists clause.
var res = someProvider.GetTable<Customer>().Select(c => new { c.CustomerID, c.Orders });
var qp = someProvider.GetQueryPlan(res.Expression);
Console.WriteLine(qp.QueryText);
[Table(Name = "Customers")]
public class Customer
{
//[Column(Name = "CustomerID")] ok
[Column(Name = "CustomerID1")]
public string CustomerID;
[Association(KeyColumns = nameof(CustomerID))]
public List<Order> Orders;// = new List<Order>();
}
[Table(Name = "Orders")]
public class Order
{
//[Column(Name = "CustomerID")] ok
[Column(Name = "CustomerID1")]
public string CustomerID;
}
Result:
SELECT t0."CustomerID1"
FROM "Customers" AS t0
SELECT t0."CustomerID1"
FROM "Orders" AS t0
Metadata
Metadata
Assignees
Labels
No labels