there is a call to my controller where something like this is performed:
someObject.Name = "Mike";
JsonResult result = Json(new { TheMan = someObject }, JsonRequestBehavior.AllowGet);
someObject.Name = "Paul";
return result;
The problem is that when the client receives the data, the name is "Paul" when I was expecting that the result JSON was created with "Mike".
In the docs it says "The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed."
Is there a workarround where I can manipulate the objects used on the JSON data without being worried about changing the response? (Clone the someObject or something)
Thanks.