Removing hard coded names from the inner select sql

Before:

V_HasOrderDetails.Name = @"=isnull((
Select max(1)
From dbo.[Order Details] 
Where OrderID = A.OrderID
),0)"; 

After:

var Order_Details = new Models.Order_Details();
V_HasOrderDetails.Name = $@"=isnull((
Select max(1)
From {Order_Details.EntityName} 
Where {Order_Details.OrderID.Name} = A.{Orders.OrderID.Name}
),0)"; 

Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com