The time the MYMVC framework handles the return value is in the ExecuteAction method (preceded by that piece of code).
Here is a simple supplementary explanation.
I have defined an interface for the action result:
public interface iactionresult{ void Ouput (HttpContext context);
4 types of ActionResult are implemented within the framework:
<summary>///represents a user control result (the user control will be executed by the framework)///</summary>public sealed class ucresult:iactionresult///< summary>///represents the result of a redirect//</summary>public sealed class redirectresult:iactionresult///<summary>/// A JSON object result///</summary>public sealed class jsonresult:iactionresult///<summary>///represents a page result (the page will be executed by the framework)/ </summary>public Sealed class Pageresult:iactionresult
To output the return value, not only using the Iactionresult interface, I also use the following call:
Context. Response.Write (Result. ToString ());
Do not underestimate the invocation of ToString ().
For a custom data type, it can be used to control the final output to the client is JSON or XML, or your own definition of the text serialization format (such as a special delimiter stitching), so it has enough capacity to replace the Jsonresult type, It also does not affect unit testing of the action.
The strong reason for ToString () is that it is a virtual method that can be overridden by a derived class.
So, if you only want to return a data entity object to the client, you can implement the Iactionresult interface and override the ToString method.
"Recommended"
1. Special recommendation : "PHP Programmer Toolkit" V0.1 version download
2. asp free Video Tutorial
3. an entry-level. NET MVC Instance
4. MYMVC The process of finding action in the box
5. the. NET MYMVC Framework performs an action-detailed procedure
6. the. NET MYMVC Framework How to assign values to a method tutorial