Fixing System.StackOverflowException was unhandled (MVC Model BINDING)
I started getting this error when submitting the form back using Binding. To test the problem, I minified the backreference to one property of the model string, but I still get an overflow error. Can anyone suggest what might be causing this?
UPDATE The problem seems to be with a property in a model that is a foreign key. If this key is removed, the binding works. How can I bind and enable foreign key relationships?
source to share
There are several ways you can fix this. One way is to try something like this.
public ActionResult AddProduct([Bind(Exclude = "Category")]Product product) { }
This says the linker is not trying to bind a category (FK property). This is a known issue and the MVC team has already installed it for RC.
You can also pass the list of exceptions to UpdateModel / TryUpdateModel and wherever you add the Bind attribute.
source to share