What should drive design consideration for the following case ?
Let's say you have Quotes.
A Quote relates to a specific Contract.
I can define my classes in the following way
Contract =
someproperty : int
Quote:
contract : Contract
Yet when i navigate I would like, even if it does not exists in my model, to be able to do
myContract.quotes
Typically, those properties are generated when using the Entity framework or some other ORM.
But the question of separating the definition from the navigation exists in full generality, even when using pure memory only classes.
(I guess one could frame in into generating the transitive closure of the navigation graph, from the subset of links specified at the definition)
My question is : what are the possible practical approach to inherit automatically those navigational properties in FSharp ? I am just a user, and not an framework developper, abnd this is very low level stuff.
[Obviously you can generalize to more complex class hierarchies can be
Maybe I've misunderstood; but could you not use an extension method to add the ability to navigate this way? You'd still need to call a function to get the quotes for the particular contract, but the helper would exist, which can just call your data provider for a filtered list of quotes for that contact?