casog
Who handles dependency Injection in a class library?
Maybe define functionality for DL injection methods as interfaces in the library and make the user handle the ancillary DI config through this mechanism first which enables the use of the rest of library. Or a middleware handler that will allow you to inject all necessary dependencies at startup based on the libraries middleware handler extension , like the aspnet.security.oauth2.providers library. I’m interested in this as well because today I ran into compiling the eBay sdk for notification api and it was just interfaces and concrete solutions for which I had to extract all concretes and implement in my consuming project and inject with the libraries interface
61 replies
Automatically logging all errors without using try-catch
Seems not, but there are patterns you can use. Maybe a CQRS pattern with a exception / logging handler at the highest level of the stack, the place where the services/data is queried
34 replies
Automatically logging all errors without using try-catch
You can use centralized exception handling in middleware by setting your applicationbuilder to "UseExceptionhandler()". Ihttps://andrewhalil.com/2022/03/10/centralized-logging-and-exception-handling-in-a-net-core-application/
34 replies