In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how to understand ASP.NET 5. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can gain something through the detailed introduction of this article.
ASP.NET 5 is a cross-era rewriting in which all functions and modules are split independently, resulting in complete decoupling. For these rewrites, Microsoft is also pretty hard, almost completely rewriting the .NET Framwrok to form a .NET Core thing. In .NET Core, everything is configurable, including Session, MVC, and so on, while all configurable features are downloadable on Nuget.
At present, ASP.NET 5 is still compatible with the old .NET Framwrok, but for cross-platform deployment, you can only use the new and modified version of. NET Core CLR.
The current ASP.NET 5 includes six sub-projects DependencyInjection, EntityFramework, Identity, KRuntime, MVC and SignalR Server. The details of each project are as follows:
DependencyInjection-basic dependency injection management with default implementation
EntityFramework-data access ORM framework
Identity-user authentication system
KRuntime-Core runtime, project system, loader
MVC-MVC framework, which integrates MVC, Web API and Web Pages functions
SignalR-Server-Real-time interactive service
Open source code for all ASP.NET 5 subprojects can be found on https://github.com/aspnet/.
ASP.NET version number interpretation
The new version of ASP.NET, called ASP.NET 5, is a framework for developing web applications using the MVC architecture, and it also provides the ability to develop RESTful services. In addition, in the next version, the framework can also use SignalR to build real-time applications. Note that ASP.NET 5 no longer includes the Web Form development framework.
5 is also the version number of the new version of the .NET framework, called Core50, also known as. NET Core. The .NET Core is a refactoring version of .NET, retaining only the minimized feature set in the original framework, and other features and functions can be downloaded and run as plug-ins through nuget. This means that we can use it for independent deployment in a variety of cloud environments. In addition, Microsoft will provide a cross-platform. NET Core so that ASP.NET programs can be deployed to Mac and Unix/Liunx servers. In addition, the .NET Core Framework can be packaged and deployed with the program, so that different versions of the .NET Core can be used on the same server.
Also note that. NET Core does not include Web Form, Windows Form, WPF, WCF, Silverlight, System.Drawing, Datatable, and so on. In other words, if your program needs to use System.Drawing for thumbnails, there is no way to use it. Similar toolsets can only be downloaded through the Nuget package. Tools can be used to find the compatibility toolset for the current program and the .NET Core.
4.5.2
4.5.2 is the version number of the current full-featured version of .NET framework. You can use this version of .NET to run ASP.NET 5, or even version 4.5.1, which allows you to use all the features of the entire .NET architecture, but not across platforms.
4.6
4.6 is the version number of the next version of the full-featured version of the .NET framework and the next version of the .NET Core. You can run ASP.NET 5 applications on .NET 4.6, but ASP.NET programs running on .NET 4.6 may not be compatible with .NET Core. The next version of ASP.NET Web Forms, which is also 4.6, will include enhancements such as asynchronous model binding, HTTP2, and starting to use the Roselyn compiler. Existing ASP.NET programs (Web Forms, MVC5 and previous versions, Web Pages) can run on .NET 4.6 without any modification.
six
The three frameworks of MVC, Web API and Web Pages in ASP.NET 5 will be merged into a single framework, collectively referred to as MVC6. This merge effort removes repetitive functionality in three frameworks, such as only one of the two Controller types in MVC and Web API. But the functions of traditional MVC, such as model binding, are retained. However, it is said that Web Pages will not be released during RTM, but will be released in * updates after RTM.
MVC6 will introduce some new features, the most striking of which are Tag Helpers and View Components. Tag Helpers is a replacement for Html Helpers, while View Components introduces a concept similar to WebControl in Web Forms.
For example, the original view model definition looks like this:
@ using (Html.BeginForm ("Register", "Account", FormMethod.Post, new {@ class = "form-horizontal", role = "form"}) {@ Html.AntiForgeryToken () Create a new account. @ Html.ValidationSummary (true, ", new {@ class =" text-danger "}) @ Html.LabelFor (m = > m.UserName, new {@ class =" col-md-2 control-label "}) @ Html.TextBoxFor (m = > m.UserName, new {@ class =" form-control "})
In the new version of MVC6, we can use Tag Helper to define:
Create a new account.
In this way, it is greatly convenient for front-end developers because you can see the normal HTML structure.
View Components solves the problem of Child Action. For example, most of the time, we use Html.Action to achieve menu and label functions. The following is an example of View Component:
Public class GreetingViewComponent: ViewComponent {public IViewComponentResult Invoke () {var greeting = "Good Morning!"; if (DateTime.Now.Hour > 12) {greeting = "Good Afternoon!";} if (DateTime.Now.Hour > 17) {greeting = "Good Evening!";} return View ("Index", greeting);}}
The view component (view component) also requires a response view file, as shown in the following example:
@ model string @ Model
To call the code, you need to use the permission Component.Invoke method, as shown in the following example:
@ Component.Invoke ("Greeting")
There is also a Component.InvokeAsync method that can be used for asynchronous calls. For more information about the use of view components, refer to the chapter on View components.
seven
7 is the next version of Entity Framework and is not part of ASP.NET 5, but it matters a lot. EF7 will be released with the RTM version of ASP.NET 5, although it may be delayed, but at least at that time there will be a basic ORM package that can run on the .NET Core, which does not include deferred loading, inheritance mapping, and is only adapted to SQL Server. If you don't run MVC6 programs across platforms, you can continue to use EF6 in .NET 4.5.2 or 4.6.
10 New changes in ASP.NET5 and MVC6
In the new versions of ASP.NET5 and MVC6, there are many changes, some of which are radical changes. For example, dependency injection technology is supported in the * * layer. To facilitate understanding, we have listed the top 10 changes for learning, as shown below:
ASP.NET 5 is now cross-platform and can run on Mac and Linux.
There is no Web Forms framework anymore.
It only supports clips, not VB.NET anymore. (it seems that recently I heard that the final version of VB.NET is going to support again.)
The new Tag syntax, @ Html.LabelFor or Html.TextBoxFor, is replaced with the new syntax or for model binding.
A new view component (View Component) is added, which can define partial content as a separate component for calling, which is very similar to WebControl in Web Forms.
Embrace the front-end technology, built-in Nodejs, NPM, Grunt, Bower technology.
Model integration, integrating MVC and WebAPI into a framework.
Support AngularJS, help built-in AngularJS module, controller, directive, and factory templates.
It supports dependency injection technology, has a native DI framework, and also supports third-party containers.
Supports xUnit.net and abandons the Visual Studio Unit Testing framework.
IDE
Needless to say, VS2015:VS2015 is still high-end, supporting not only Nodejs and Python development, but also Android and iOS development.
Visual Studio Code: in order to be able to write C # programs on the Mac or Linux operating systems, Microsoft has released a Visual Studio Code lightweight editor that can use the above operating systems, which is still high-end, with new features and features killing Sublime Text and Brackets instantly.
The above is how to understand ASP.NET 5. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.