In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
With the release of .NET Core 2.0,. NET open source cross-platform ushered in a new era. Developers can choose to use the command line, their favorite text editor, Visual Studio 2017 and Visual Studio Code to develop their own .NET Core 2.0 projects. At the same time, the Microsoft .NET Development tools Group has also announced the release of ASP.NET Core 2.0, which is compatible with .NET Core 2.0, Visual Studio 2017 15.3, and the new Razor Pages page optimization paradigm. It is believed that the most discussed question among developers in the technology community is: should the code be migrated to ASP.NET Core 2.0? "
The answer is yes.
Let's take a look at the benefits of migrating code to ASP.NET Core 2.0.
Performance
Performance improvement is the most significant change brought about by ASP.NET Core 2.0.
With the advent of new technologies and language enhancements in ASP.NET Core 2.0, the code is automatically optimized at compile time.
The benefit of this change is that individuals no longer need to change the code. The compiler optimizes the code when it is recompiled with new language enhancements.
TechEmpower found that ASP.NET Core has made significant improvements in performance in more than 230 frameworks that use Web framework benchmarks.
A new coding paradigm
The release of a new version of ASP.NET Core introduces a new coding paradigm. The new coding paradigm makes page-based design and coding simpler and easier than Model-View-Controller structures. Using Razor Pages as the first page structure allows developers to focus more on the user interface.
If you are familiar with configuring the ASP.NET Core Startup class for MVC, you can add the following code to the Startup class:
Public class Startup {public void ConfigureServices (IServiceCollection services) {/ / Includes support for Razor Pages and controllers. Services.AddMvc ();} public void Configure (IApplicationBuilder app) {app.UseMvc ();}}
AddMvc and UseMvc in the Startup class make configuration calls and activate the "Razor Pages" function.
More complex structures can be built with new PageModel objects. PageModel is a concept of the MVVM architecture that allows developers to execute methods and bind properties to the content of the page being rendered.
Template enhancement
The templates included with ASP.NET Core have been enhanced to include not only Web applications built using the MVC pattern, but also Razor Pages Web application templates, as well as a series of templates that can build single-page applications (SPA) for browsers. These SPA templates use JavaScript services capabilities to embed NodeJS into ASP.NET Core on the server and compile JavaScript server-side applications as part of the .NET build process.
DbContext Pooling
Many ASP.NET Core applications can now achieve performance gains by registering their DbContext-type services and configuring them to use pre-created instance pools, thus avoiding creating new instances for each request.
DbContext pooling can be enabled by adding the following code to the startup / configuration service.
Services.AddDbContextPool
< BloggingContext >(options = > options.UseSqlServer (connectionString)); Monitoring and configuration promotion
When ASP.NET Core 2.0 runs on Azure App Service, it not only does not need to make any changes, but also provides integration capabilities, while obtaining the performance analysis, error reports, and diagnostics provided by Azure Application Insights. In Visual Studio 2017, right-click project and select "Add-Application Insights Telemetry", and the application starts collecting data. Finally, you can view the performance of the application directly in Visual Studio 2017, including all log messages.
Razor update
The Razor engine has been updated and the new Roslyn compiler is now available, including support for Clear7.1 features such as default expressions, inference tuple names and generic pattern matches. To use the Clear7.1 feature in a project, you need to add the following properties to the project file, and then reload the solution:
Latest simplifies host configuration
Host configuration has been greatly simplified. The default ASP.NET Core template contains a new WebHost.CreateDefaultBuilder, which automatically allocates a Kestrel server. If the Kestrel server is available, it will run on IIS and configure standard console logging. The Program.cs file has been simplified to the following:
Public class Program {public static void Main (string [] args) {BuildWebHost (args). Run ();} public static IWebHost BuildWebHost (string [] args) = > WebHost.CreateDefaultBuilder (args) .UseStartup () .build ();} Summary
Not only does ASP.NET Core 2.0 bring significant performance improvements, but the update to this version also provides a new way to write applications and simplifies the process of managing applications. All of these constitute a reason for everyone to migrate their code to ASP.NET Core 2.0.
Reference article:
Https://dzone.com/articles/4-benefits-of-migrating-to-aspnet-core-20
Https://blogs.msdn.microsoft.com/webdev/2017/08/14/announcing-asp-net-core-2-0/
Reprint, please indicate from: grape city control
About Grape City
Grape City is a global control industry leader and the world's leading provider of enterprise application customization tools, enterprise reports and business intelligence solutions, serving more than 75% of the world's Fortune 500 companies.
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.