c# - Single property for inhertance hierarchy -


i have property returns result, how can write property such result remains same derived classes. have tried

  // in base class   // gives new object everytime public virtual result propertyx=> new result();  public virtual result propertyx { // returns new object classes derived derived class  // of base class( grand child class may be!!!)  get{ return result?? new result();}  set{ resultfield=value;}  } 

supposing hierachy base- derived1- grandchild1

when derived class intantiated result property set, problem is, when grandchild instantiated result intantiated again, want check if result set, if result set should reused.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -