Stack overflow exception in c# setter -


It's easy to explain: it works

  using the system; ConstraintSet = System.Collections.Generic.Dictionary & lt; System.String, double> Namespace Console Application 2 {class test {public interruption one {get; Set; } Public examination () {a = new restriction (set); } Fixed zero main (string [] args) {test abc = new test (); Console.WriteLine ("Done"); }}}  

this

  does not use the system; ConstraintSet = System.Collections.Generic.Dictionary & lt; System.String, double> Namespace Console Application 2 {class test {A set of public obstructions {A {A return; } Set {a = value; }} Public trial () {a = new ConstraintSet (); } Fixed zero main (string [] args) {test abc = new test (); Console.WriteLine ("Done"); }}}  

I get a stack overflow exception on the setter in the second category and I do not know why I can not use the first form because it is not supported by Integration Engine

When you type a = value , you can call the property setter again Are there.

To use non-automatic properties, you need to create a separate private backing field, such as:

  restriction one; Public obstacles A {Go {return; } Set {a = value; }}  

Comments