Closed grahamboree closed 7 years ago
Currently PostDoc needs to be a public Func that's set on an instance of an object like so:
class Ship { public System.Func<Ship, Ship> PostDoc = (d) => { // ... return d; }; }
whereas FromDoc is a public static method that operates similarly:
class Ship { public static Ship FromDoc(Ship existing, DocNode doc) { // ... return existing; } }
There's a few issues with the PostDoc style:
With these considerations, I think it seems to make sense to author PostDoc like FromDoc:
class Ship { public Ship PostDoc(Ship existing) { // ... return existing; }; }
+1
I think it's really only used in the demo, as currently written.
Currently PostDoc needs to be a public Func that's set on an instance of an object like so:
whereas FromDoc is a public static method that operates similarly:
There's a few issues with the PostDoc style:
With these considerations, I think it seems to make sense to author PostDoc like FromDoc: