I play with StructuredFormatDisplay, and I suggested that I can use several properties for Value, but it seems that it is not. This question (and the accepted answer) talks about tuning in general, but in the examples given, only one property is used. MSDN does not help when it comes to using this attribute.
Here is my example:
[<StructuredFormatDisplay("My name is {First} {Last}")>]
type Person = {First:string; Last:string}
If I then try this:
let johnDoe = {First="John"; Last="Doe"}
I get this error:
<StructuredFormatDisplay exception: Method 'FSI_0038+Person.First}
{Last' not found.>
The error seems to hint that it only captures the first property mentioned in mine Value, but it's hard for me to say this with certainty.
I realized that I could get around this by declaring my type as follows:
[<StructuredFormatDisplay("My name is {Combined}")>]
type Person = {First:string; Last:string} with
member this.Combined = this.First + " " + this.Last
, - , , , .
- source :
F # PreText {PropertyName} PostText
, , , , -, , , , .