Reduce code duplication in DI extensions.
Merge pull request #439 from stloyd/bugfix/cs

[RFC] Reduce code duplication in DI