Created
February 23, 2024 16:34
-
-
Save bgavrilMS/fd70a44bca9ad194d2d453c4e7b3669d to your computer and use it in GitHub Desktop.
This file contains 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
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello, World!"); | |
} | |
} | |
public class ManagedIdentityApplication | |
{ | |
private ManagedIdentityClient _managedIdentityClient; | |
public ManagedIdentityApplication() | |
{ | |
_managedIdentityClient = new ManagedIdentityClient(); | |
} | |
} | |
public class ManagedIdentityClient | |
{ | |
private static BaseManagedIdentitySource _managedIdentitySource; | |
public ManagedIdentityClient() | |
{ | |
} | |
public int SendRequest() | |
{ | |
if (_managedIdentitySource == null) | |
{ | |
_managedIdentitySource = new Imds(); | |
} | |
return _managedIdentitySource.MakeRequest(); | |
} | |
} | |
public class HttpClientWithRetries | |
{ | |
public string Send() | |
{ | |
return "Hello, World!"; | |
} | |
} | |
public class BaseManagedIdentitySource | |
{ | |
private readonly HttpClientWithRetries _httpClientWithRetries; | |
public BaseManagedIdentitySource(HttpClientWithRetries httpClientWithRetries) | |
{ | |
_httpClientWithRetries = httpClientWithRetries; | |
} | |
public int MakeRequest() | |
{ | |
_httpClientWithRetries.Send(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment