Contents
.NET 5 REST API Tutorial – Build From Scratch With C#
นอกจากการดูบทความนี้แล้ว คุณยังสามารถดูข้อมูลที่เป็นประโยชน์อื่นๆ อีกมากมายที่เราให้ไว้ที่นี่: ดูความรู้เพิ่มเติมที่นี่
Learn how to create a REST API endtoend from scratch using the latest .NET 5 innovations and Visual Studio Code. The API will be written in C.
💻 Get the code: https://youtube.dotnetmicroservices.com/net5restapi10
✏️ Course developed by Julio Casal. Check out his channel: https://www.youtube.com/c/jcasalt
🔗 Julio’s website: https://dotnetmicroservices.com
⭐️ Course Contents ⭐️
Getting Started
0:00:00 Introduction
0:03:02 Creating the project
0:04:01 Exploring the generated project files
0:10:03 Trusting the selfsigned certificate
0:11:36 Exploring the default Swagger UI page
0:12:30 Configuring Visual Studio Code settings
Entity, Repository, Controller GET
0:14:33 Introduction
0:15:45 Adding an entity
0:20:39 Ading an inmemory repository
0:26:40 Creating the controller
0:30:42 Implemeting GET all items
0:33:37 Implemeting GET single item
0:37:47 Returning a 404 NotFound status code
Dependency Injection, DTOSs
0:39:57 Introduction
0:41:23 What is dependency injection?
0:46:14 Extracting the repository interface
0:47:44 Injecting the repository into the controller
0:48:53 Registering the repository as a singleton
0:52:32 Adding a Data Transfer Object DTO
0:55:46 Creating the AsDto extension method
POST, PUT, DELETE
0:58:59 Introduction
0:59:45 Implementing POST
1:07:39 Adding validations via data annotations
1:10:00 Implemeting PUT
1:17:33 Implementing DELETE
Persisting Entities with MongoDB
1:20:46 Introduction
1:24:44 Using Postman
1:27:53 Creating a MongoDB repository
1:29:42 Using the MongoDB.Driver NuGet package
1:33:28 Implementing MongoDB Create
1:33:57 Running the MongoDB Docker container
1:38:47 Configuring MongoDB connection settings
1:42:38 Registering the MongoClient singleton
1:48:02 Testing the MongoDB integration
1:50:04 Exploring the created database in VS Code
1:52:45 Implemeting MongoDB Get, Update and Delete
Tasks, Async and Await
2:02:27 Introduction
2:06:46 Using the Async suffix
2:09:04 Using tasks in the repository
2:11:50 Using async and await
2:14:28 Returning completed tasks
2:18:16 Using tasks in the controller
2:21:23 Testing async methods in Postman
Secrets and Health Checks
2:27:02 Introduction
2:30:06 Enabling authentication in MongoDB
2:33:36 Using the .NET Secret Manager
2:36:40 Using the MongoDB credentials in the service
2:40:00 Introduction to Health Checks
2:42:28 Adding an endpoint for health checks
2:44:46 Adding a MongoDB health check
2:48:41 Adding checks for readiness and liveness
2:53:51 Customizing the health check response
2:58:59 Exploring other health check NuGet packages
Docker
3:00:44 Introduction
3:08:28 What is Docker?
3:17:54 Removing https redirection
3:20:39 Generating a Dockerfile in VS Code
3:30:40 Building the Docker image
3:33:00 Adding a Docker network
3:34:07 Running the containers in the Docker network
3:40:36 Running the REST API in Docker
3:42:02 Pushing the container image to Docker Hub
3:46:02 Exploring the image in Docker Hub
3:46:32 Pulling the image back to the local box
Kubernetes
3:49:20 Introduction
3:54:05 What is Kubernetes?
4:04:06 Enabling a Kubernetes cluster in Docker Desktop
4:06:12 Installing the Kubernetes extension for VS Code
4:06:58 Declaring the REST API Kuberentes deployment
4:14:35 Creating a secret in Kubernetes
4:17:28 Declaring health probes
4:19:14 Declaring the REST API Kubernetes service
4:22:56 Creating the REST API resources in Kubernetes
4:26:15 Declaring the MongoDB Kubernetes StatefulSet
4:36:09 Declaring the MongoDB Kubernetes service
4:38:27 Creating the MongoDB resources in Kubernetes
4:40:42 Testing the REST API hosted in Kubernetes
4:42:08 Exploring the Kubernetes selfhealing capability
4:46:04 Scaling Kubernetes pods
4:47:38 Adding logs via ILogger
4:52:04 Getting a new image version into Kubernetes
4:53:23 Load balancing requests across pods
Unit Testing and TDD
4:56:23 Introduction
4:57:04 What is unit testing?
5:01:19 What is test driven development?
5:04:25 Restructuring files and directories
5:08:25 Creating the xUnit test project
5:09:15 Building multiple projects in VS Code
5:13:10 Adding NuGet packages for unit testing
5:14:35 Testing GetItemAsync unexisting item
5:18:35 Using the AAA pattern
5:19:31 Stubbing dependencies via Moq
5:26:52 Running tests in VS Code
5:28:05 Using the .NET Core Test Explorer extension
5:30:55 Testing GetItemAsync existing item
5:38:01 Using FluentAssertions
5:41:46 Testing GetItemsAsync
5:45:41 Testing CreateItemAsync
5:53:13 Testing UpdateItemAsync
5:57:51 Testing DeleteItemAsync
5:59:40 Refactoring and catching regressions
6:10:50 Using TDD to test a yet to be created method
6:19:07 Going back to green by fixing the failing test
6:21:19 Testing the new controller method in Postman
How to Uninstall .NET Framework 3.5 on Windows 10/7/XP?
TRY this best uninstall tool@ https://macpaw.audw.net/c/376211/154407/1733 if U R having issue (disabling) uninstalling .NET Framework 3.5 and/or any other unwanted programs on Windows.
Extra info:
1. You may be able to turn off the .NET Framework in your operating system once that application is installed on your Windows.
2. .NET Framework 3.5 was developed by Microsoft@ http://www.microsoft.com/enus/download/details.aspx?id=21
BTW, Windows 10 \u0026 7 users can get .NET 3.5 disabled manually only.
Hướng Dẫn Cài .Net Framework 3.5 Trên Windows 10
Video này hướng dẫn cho bạn cách cài .Net Framework 3.5 Trên Windows 10. Nhưng mà thật ra thì các bạn vẫn có thể làm được trên Win 7 hoặc Win 8.
Lệnh chạy:
DISM /Online /EnableFeature /FeatureName:NetFx3 /All /LimitAccess /Source:e:\\sources\\sxs
Check .Net Framework Version Installed in Your PC | Windows 10
Check .Net Framework Version Installed in Your PC | Windows 10.
Command Used:
reg query \”HKLM\\SOFTWARE\\Microsoft\\Net Framework Setup\\NDP\” /s
Users can install and run multiple versions of the .NET Framework on their computers. When you develop or deploy your app, you might need to know which .NET Framework versions are installed on the user’s computer. The registry contains a list of the .NET Framework versions installed on a computer.
On Windows 10. .NET Framework (\”dot net\”) is a development platform made up of programming languages, libraries, and tools that allow developers to build different types of applications for desktop, laptops, and tablets as well as web apps, games, and much more.
The .NET platform is also opensource and crossplatform, which means it’s supported on Windows, Linux, and macOS.
Although, for the most part, you don’t need to worry about the version of .NET installed on Windows 10, some applications require a specific release to run. Programmers usually need to run multiple versions of the platform to develop and deploy apps, and this is when understanding the versions of .NET available on your device can come in handy.
Whatever the reason it might be, you can use at least three ways to determine the .NET Framework version using Command Prompt, PowerShell, and Registry.
The .NET Framework consists of two main components, which are versioned separately:
A set of assemblies, which are collections of types and resources that provide the functionality for your apps. The .NET Framework and assemblies share the same version number. For example, .NET Framework versions include 4.5, 4.6.1, and 4.7.2.
The common language runtime (CLR), which manages and executes your app’s code. A single CLR version typically supports multiple .NET Framework versions. For example, CLR version 4.0.30319.xxxxx where xxxxx is less than 42000, supports .NET Framework versions 4 through 4.5.2. CLR version greater than or equal to 4.0.30319.42000 supports .NET Framework versions starting with .NET Framework 4.6.
This tutorial will apply for computers, laptops, desktops,and tablets running the Windows 10, Windows 8/8.1, Windows 7 operating systems. Works for all major computer manufactures (Dell, HP, Acer, Asus, Toshiba, Lenovo, Samsung).
วิธีดาวน์โหลด .NET Framework 4.8, 3.5, 3.0, 2.0 และการติดตั้งใน Windows 10
กลุ่มพูดคุยเรื่องไอที https://www.facebook.com/groups/modifyit
สำหรับใครที่อยากจะดาวน์โหลด .NET Framework 4.8, .NET Framework 3.5, .NET Framework 3.0, .NET Framework 2.0 หรือเวอร์ชันอื่นๆ สามารถดาวน์โหลดได้ง่ายๆ
ลิงค์ภายในคลิป สำหรับปัญหาการติดตั้งไม่ได้ผ่าน Windows Features ขึ้น Error ดังต่อไปนี้ 0x800f0906, 0x800f0907, 0x800f081f, or 0x800F0922 ให้ทำตามลิงค์แก้ไข Error ด้านล่าง
ลิงค์ดาวน์โหลด https://dotnet.microsoft.com/download/dotnetframework
ลิงค์แก้ไข Error ต่างๆ https://docs.microsoft.com/thth/troubleshoot/windowsclient/applicationmanagement/dotnetframework35installationerror
นอกจากการดูหัวข้อนี้แล้ว คุณยังสามารถเข้าถึงบทวิจารณ์ดีๆ อื่นๆ อีกมากมายได้ที่นี่: ดูบทความเพิ่มเติมในหมวดหมู่WIKI