.NET Core Starter

  

        .Net core MVC
       how to use .NET Core, the most basic entry, many too many examples of blog and official website have, but most people do not really make a white step by step to learn,

     I first contacted, even the most basic wwwroot do not know is doing with. Now we take a look at it is doing -

    What is a .NET Core, what advantage?

    1. ASP.NET Core is a cross-platform open source framework for generating new cloud-based Web applications on Windows, macOS or Linux

    2. Benefits: • Web UI and scene generation unified Web API's.
        • constructed for testability.
          • Razor Pages can be based on the coding of the page more simple and efficient.
          • Blazor allows you to use C # and JavaScript in your browser. Share all written using .NET server-side and client-side application logic.
        • Ability to develop and run on Windows, macOS and Linux.
        • Open Source and community-centered.
        • Integration of new client framework and development workflow.
        • Ready Configurations System cloud-based environments.
        • Built-dependency injection.
        • Modular lightweight, high-performance HTTP request pipeline.
        • can be hosted on KestrelIIS, Nginx, Apache, Docker or self-hosted in its own process.
        • Concurrent Versioning.
        • new tools to simplify Web development.

    Two to create Web applications

      1. Create a new project, as shown at the point where
               

      2. Click the Web application or the other can be, here with Web-based MVC application.

      3. Create a success, successful solutions created here is structured as follows:

      

      Structure than that, three: a controller, model, view -

      4. File understanding

       Now start from the first step

       wwwroot : as a server homepage, providing server, to upload their own files, people can access the files you upload. Equivalent proxy server. The most important thing is that you must file referenced in it, it is equivalent to a folder, such as: JavaScript, CSS, etc.

         Here quoted bootstrap document

       

         Dependency : You can add the assembly

         Controller, model, view

       MVC application model (M) represents the state of the application and any service logic that should be executed or operations.

       View (V) responsible for displaying content through the user interface.

       The controller (C) is a process the user interaction, and finally selected using a model component view to be rendered.

         appsettings.json : the .Net Framework's web.config project will be used, app.config these files , and appsettings.json is Asp.Net Core instead of one of these config files, it supports more flexible data structure

                 For example: Link database configuration

                    
         Program.cs: Start track file entry tasks performed CreateWebHostBuilder
                                              1, host and application loading configuration information table
               2, the configuration log
               3 disposed Web server
               4, provided Asp.Net Core hosting application form.

      Startup category :

            1. You have to configure any service required by the application.

            2. The request processing pipeline defined.

                 3. The configuration (or register) is added to the code for the service Startup.ConfigureServices process. Service is a component used by the application. For example, Entity Framework Core is a service context object.

              4. The configuration request code is added to the processing pipeline Startup.Configure process. Intermediate pipe consists of a series of components.

              For example, the middleware may handle requests for static files or redirects HTTP requests to HTTPS. Each middleware for asynchronous operation on a HttpContext, and then invokes the next intermediate conduit or termination request.

 

Guess you like

Origin www.cnblogs.com/wgys/p/11506307.html