New features in ASP. NET 5 and MVC 6, asp. netmvc
I almost forgot to mention that the default rendering engine Razor in MVC 6 will also be updated to support the new syntax in C #6. The new features in Razor are more than that.
In some cases, embedding some JSON data directly on a Web page may be more appropriate than initiating an additional request to the server. In earlier versions, you need to write some tedious ing code to achieve this. Then, you can use a JSON converter to serialize the data objects and expose the results through the view model. In MVC 6, all the above sample code can be simplified into a sentence "@ Json. Serialize (Model )".
When caching images, a large number of sample codes are also encountered. The image cache itself is very simple, but to find a way to notify the browser to invalidate the cache, there are often a lot of tedious temporary solutions. By using the brand new Image Tag Helper, you only need to set the asp-file-version attribute to true, MVC automatically attaches a version number to the image file name to clear the cache ".
The Tag Helper framework has also been improved to some extent. You can now "bind the server attribute in Tag Helper with the Dictionary attribute ". Whether the Server property exists or not will make Tag Helper take effect selectively. For more information about how to write a custom Tag Helper, see Jeff Fritz's article "getting started with ASP. net mvc Tag Helper ".
The routing token allows you to write expressions similar to "[Route (" Products/[action] ")" at the class level. In MVC 6, the same token can be used in the route name, which is helpful for the diagnosis process.