Suppose we have Model
several properties on it, and we want to create a decorator class for this model to improve it with some additional properties. Now we want to create a new instance DecoratedModel
filled with all the property values Model
, possibly using the constructor with Model
as a parameter:
public class DecoratedModel : Model
{
public DecoratedModel(Model baseModel)
{
}
}
What would be the most common, concise way to populate DecoratedModel
out Model
?
source
share