Is there any calculation engine for C# that can automatically recalculate dependent fields when a value changes?
Let me freestyle for a second, I'm imagining something like this..
Field<double> quantity = Field.Create<double>("Quantity");
Field<double> unitCost = Field.Create<double>("Unit Cost");
Field<double> total = Field.Create<double>("Total");
total.Calculation((q,uc) => q * uc, quantity, value);
// would have signature something like this:
// void Calculation<TR,T1,T1>(Func<TR,T1,T2>, Field<T1>, Field<T2>)
This would set up fields that auto-propagate dependent values.
quantity.Value = 5.0;
unitCost.Value = 1.5;
Assert.That(total.Value, Is.EqualTo(7.5));
Obviously this is a simple example, the end uses would be much more akin to the calculations of a complex spreadsheet.
Thinking further it would be amazing if the field/cells would support change notification.