I have many classes that implement an interface. Whenever I define a class I have to write something like this within the class definition:
interface Model.IModel with
member this.Assets = modelArg.Assets
member this.AuxData = modelArg.AuxData
member this.Benchmark = modelArg.Benchmark
member this.CalcPeriods = modelArg.CalcPeriods
member this.CashTicker = modelArg.CashTicker
member this.Description = modelArg.Description
member this.FirstValidDate = modelArg.FirstValidDate
member this.Name = modelArg.Name
member this.ParamData = modelArg.ParamData
member this.ParamList = modelArg.ParamList
member this.Strategy = modelArg.Strategy
member this.CalcStartTime with get() = calcStartTime and
set v = calcStartTime <- v
member this.Counter with get() = counter and
set v = counter <- v
Is there a way to avoid repeating this for each and every class that derives from the interface IModel? The code is identical in all cases.