Hướng dẫn asp.ne core
In the ASP.NET Core series, we are going to go through a detailed example of how to use .NET Core, Angular, and MySQL for ASP.NET Core web application development. Show
If someone asks: “Why this combination of technologies”, without getting in too much detail, the answer would be:
What are we going to do in this guide?We are going to use MySQL as our database. First, we are going to install the MySQL server, create tables, and populate them with some data. Then, we are going to step into the world of ASP.NET Core Web API development. It is going to be our server-side part of the application. As we progress through the ASP.NET Core series, we are going to use repository pattern, generics, LINQ, entity framework core, create more projects and services to demonstrate some good practices. Overall we will try to write the application as we would in the real-time environment. Furthermore, you will learn about ASP.NET Core architecture and code organization, so you can make it more readable and maintainable. There are three approaches to using Entity Framework: Database First, Code First, and Model First. In this tutorial, we are going to use the Database First approach, because we want to create our database prior to typing the .NET code. This approach is good when you know the structure of your database beforehand, and we get to use the visual editor which makes the creation of relationships between tables much easier. After we finish the ASP.NET Core series, we are going to introduce three of the most popular client frameworks (Angular, React, or Vue.js) to consume our Web API. This will result in creating a full-stack web application. In the end, we are going to publish our app on both Windows and Linux OS, and finish strong by completing the entire development cycle. Prerequisites:
Background
Basic ASP.NET Core Web API:
Advanced ASP.NET Core Web API Concepts:
ASP.NET Core Application Configuration:
Consuming ASP.NET Core Web API:
Hosting ASP.NET Core Web API on different platforms:
Chuyển đến nội dung chính Trình duyệt này không còn được hỗ trợ nữa. Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật. Get started with ASP.NET Core MVC
Trong bài viết nàyBy Rick Anderson This tutorial teaches ASP.NET Core MVC web development with controllers and views. If you're new to ASP.NET Core web development, consider the Razor Pages version of this tutorial, which provides an easier starting point. See Choose an ASP.NET Core UI, which compares Razor Pages, MVC, and Blazor for UI development. This is the first tutorial of a series that teaches ASP.NET Core MVC web development with controllers and views. At the end of the series, you'll have an app that manages and displays movie data. You learn how to:
View or download sample code (how to download). PrerequisitesCreate a web app
For alternative approaches to create the project, see Create a new project in Visual Studio. Visual Studio uses the default project template for the created MVC project. The created project:
The tutorial assumes familiarity with VS Code. For more information, see Getting started with VS Code and Visual Studio Code help.
For Visual Studio for Mac, see the .NET 5 version of this tutorial. Run the app
Visual Studio runs the app and opens the default browser. The address bar shows Launching the app without debugging by selecting Ctrl+F5 allows you to:
You can launch the app in debug or non-debug mode from the Debug menu: You can debug the app by selecting the MvcMovie button in the toolbar: The following image shows the app:
Launching the app without debugging by selecting Ctrl+F5 allows you to:
For Visual Studio for Mac, see the .NET 5 version of this tutorial.
Visual Studio help
Visual Studio Code help
Visual Studio for Mac help
In the next tutorial in this series, you learn about MVC and start writing some code. This tutorial teaches ASP.NET Core MVC web development with controllers and views. If you're new to ASP.NET Core web development, consider the Razor Pages version of this tutorial, which provides an easier starting point. See Choose an ASP.NET Core UI, which compares Razor Pages, MVC, and Blazor for UI development. This is the first tutorial of a series that teaches ASP.NET Core MVC web development with controllers and views. At the end of the series, you'll have an app that manages and displays movie data. You learn how to:
View or download sample code (how to download). PrerequisitesCreate a web app
For alternative approaches to create the project, see Create a new project in Visual Studio. Visual Studio used the default project template for the created MVC project. The created project:
The tutorial assumes familiarity with VS Code. For more information, see Getting started with VS Code and Visual Studio Code help.
Run the app
Launching the app without debugging by selecting Ctrl+F5 allows you to:
You can launch the app in debug or non-debug mode from the Debug menu item: You can debug the app by selecting the IIS Express button The following image shows the app:
Launching the app without debugging by selecting Ctrl+F5 allows you to:
You can launch the app in debug or non-debug mode from the Run menu. The following image shows the app:
Visual Studio help
Visual Studio Code help
Visual Studio for Mac help
In the next part of this tutorial, you learn about MVC and start writing some code. This tutorial teaches ASP.NET Core MVC web development with controllers and views. If you're new to ASP.NET Core web development, consider the Razor Pages version of this tutorial, which provides an easier starting point. See Choose an ASP.NET Core UI, which compares Razor Pages, MVC, and Blazor for UI development. This is the first tutorial of a series that teaches ASP.NET Core MVC web development with controllers and views. At the end of the series, you'll have an app that manages and displays movie data. You learn how to:
View or download sample code (how to download). PrerequisitesCreate a web app
Visual Studio used the default project template for the created MVC project. The created project:
The tutorial assumes familiarity with VS Code. For more information, see Getting started with VS Code and Visual Studio Code help.
Run the app
Launching the app without debugging by selecting Ctrl+F5 allows you to:
You can launch the app in debug or non-debug mode from the Debug menu item: You can debug the app by selecting the IIS Express button The following image shows the app:
Launching the app without debugging by selecting Ctrl+F5 allows you to:
Visual Studio for Mac displays the following popup: Select Yes if you trust the development certificate. The following dialog is displayed: Enter your password and select OK Select Yes if you agree to trust the development certificate. See Trust the ASP.NET Core HTTPS development certificate for more information The address bar shows You can launch the app in debug or non-debug mode from the Run menu. The following image shows the app:
Visual Studio help
Visual Studio Code help
Visual Studio for Mac help
In the next part of this tutorial, you learn about MVC and start writing some code. Phản hồiGửi và xem ý kiến phản hồi dành cho |