Last active
March 1, 2019 13:29
-
-
Save mr5z/9492582e08fcc03ddc65d664228b7a72 to your computer and use it in GitHub Desktop.
circular dependency in IoC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthService : IAuthService | |
{ | |
AuthService(IDataService dataService) { } | |
void RequestAuth() | |
{ | |
var result = dataService.PostAsync(...) | |
} | |
} | |
class HttpDataService : IDataService | |
{ | |
HttpClient httpClient = ... | |
HttpDataService(IAuthService authService) { } | |
Task<TResult> GetAsync(...) { ... } | |
Task<TResult> PostAsync(...) { ... } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment