Use Attributes & Middleware in ASP.NET Core for Logging, Telemetry, and Anything Else

from blog Blog posts on .NET Software Development, C#, and Debugging on Michael's Coding Spot, | ↗ original
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...