這個專案專注於利用 AspectCore 實作 AOP 機制。
This project focus on the use of AspectCore to implement AOP mechanism.
練習套用 AspectCore 實作 AOP 機制於 .NET Core 3.1 上。
To practice how AOP mechanism with AspectCore implement on .NET Core 3.1.
假如你想要直接測試應用程式,可以使用 Postman 或其他一些用於模擬 Client-side 行為的應用程式。
If you want to interactively test the application, you can use Postman or any other Http client.
透過 Visual Studio 2019 或者利用
dotnet run
指令先把專案跑起來。
- Run the project from Visual Studio 2019 or by typing
dotnet run
in a command window
透過 Postman 製作一個如下所示之 GET 要求
- Launch Postman and make a GET request as follows:
GET https://localhost:5001/customexecutexxxx HTTP/1.1
cache-control: no-cache
Accept: */*
Host: localhost:5001
accept-encoding: gzip, deflate, br
Connection: keep-alive
便會得到以下回應:
returns the following response:
CustomService.ExecuteXXXX method executed via serviceaop.
製作另一個如下所示之 GET 要求
- Then make another a GET request like the following:
GET https://localhost:5001/otherexecutexxxx HTTP/1.1
cache-control: no-cache
Accept: */*
Host: localhost:5001
accept-encoding: gzip, deflate, br
Connection: keep-alive
便會得到以下回應:
returns the following response:
OtherService.ExecuteXXXX method executed.
總結來說,第一個被執行的方法會被 ServiceAop 抓到,而第二個被執行的方法則不會被 ServiceAop 抓到。
- To sum up, first one executed method can catched by serviceaop, second one executed method can't catched by serviceaop.
1.0.0.0 (March 19, 2020)
- 1.0.0.0
- Initial Commit (初次上版)
AspectCore-Framework by dotnetcore