Relations Recompute
- Let's add a relation to our demo
public class DemoColumnsCollection : UIControllerBase
{
public readonly Models.Orders Orders = new Models.Orders();
public readonly Models.Customers Customers = new Models.Customers();
public DemoColumnsCollection()
{
From = Orders;
Relations.Add(Customers, Customers.CustomerID.IsEqualTo(Orders.CustomerID));
Columns.Add(Orders.OrderID);
Columns.Add(Orders.CustomerID);
Columns.Add(Orders.OrderDate);
}
public void Run()
{
Execute();
}
protected override void OnLoad()
{
View = () => new Views.DemoColumnsCollectionView(this);
}
}
Relations will only recompute based on columns that were added before the relation’s first column in the column collection
public class DemoColumnsCollection : UIControllerBase
{
public readonly Models.Orders Orders = new Models.Orders();
public readonly Models.Customers Customers = new Models.Customers();
public DemoColumnsCollection()
{
From = Orders;
Relations.Add(Customers, Customers.CustomerID.IsEqualTo(Orders.CustomerID));
Columns.Add(Orders.OrderID);
Columns.Add(Orders.CustomerID);
Columns.Add(Customers.CustomerID);
Columns.Add(Orders.OrderDate);
}
public void Run()
{
Execute();
}
protected override void OnLoad()
{
View = () => new Views.DemoColumnsCollectionView(this);
}
}
- Note that if the
Columns.Addof theCustomers.CustomerIDcolumn is after the call toColumns.Addof theOrders.CustomerIDcolumn, the relation toCustomerswill automatically recompute (refresh) whenever the value ofOrders.CustomerIDchanges - Note that if the
Columns.Addof theCustomers.CustomerIDcolumn is Before the call toColumns.Addof theOrders.CustomerIDcolumn, the relation toCustomerswill NOT automatically recompute (refresh) whenever the value ofOrders.CustomerIDchanges, it'll only evaluate once when you enter the row. - Note that you can also use the
__RecomputePathproperty to explore the recompute of a relation. For more information see Columns Recompute
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com