Ho questa classe:C'è un modo per impostare le proprietà automatiche nei costruttori secondari?
type Sample() =
member val test1 = "" with get,set
member val test2 = "" with get,set
// is something like the below constructor possible
new Sample(result1, result2) =
this.test1 <- "failed"
this.test2 <- "passed"
Sample()
Ho provato molti modi diversi, ma non riesco a farlo funzionare.
Compila, ma non fa quello che mi aspetto che faccia ... –
Huh. Suppongo che sia perché gli argomenti non sono stati usati (che è anche quello che ha fatto il codice OP). – scrwtp
@ Mark Seemann, Ci dispiace, ma cosa ti aspetti che faccia? https://dotnetfiddle.net/wq711M –