关于[Use Attributes & Middleware in ASP.NET Core for Logging, Telemetry, and Anything Else]的摘要:
Every once in a while you need to add meta functionality without actually changing the business logic code. This might be reporting telemetry, logging, or adding metrics. While necessary, writing this code along with the business logic feels kind of wrong. There's no separation of concerns, it makes the business logic harder to read, and it's prone to bugs.
原文地址: https://michaelscodingspot.com/attributes-and-middleware-in-asp-net-core/