37660a2e38
* Add anti-patterns example in DI recommendations According to https://github.com/dotnet/AspNetCore.Docs/pull/19156, we'd like to add a new anti-patterns to DI recommendations in DI docs. The reason is in Stackoverflow, some community member is suggesting to call BuildServiceProvider to resolve service instance in ConfigureService method(https://stackoverflow.com/questions/31863981/how-to-resolve-instance-inside-configureservices-in-asp-net-core), which will result to couple issues as described in this PR. So it is better to add this as an anti-patterns in recommendations and provide an alternative way to address developers requirement. * Add ✔️and ❌before correct and incorrect Add ✔️and ❌before correct and incorrect * xboxeer anti-pattern DI PR * clean up * clean up * clean up * clean up * clean up * clean up Co-authored-by: Elendil <yuzheng1@microsoft.com> |
||
---|---|---|
.. | ||
bad.png | ||
bad2.png | ||
badcode.png | ||
badcodeX.png |