The second letter in the Hebrew alphabet is the ב bet/beit. Its meaning is "house". In the ancient pictographic Hebrew it was a symbol resembling a tent on a landscape.
Note: Pre-release packages are distributed via feedz.io.
This Library provides registration for hosting container of IHost
interface for HttpClient
message handlers.
If you like or are using this project to learn or start your solution, please give it a star. Thanks!
dotnet add package Bet.Extensions.Hosting.Resilience
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
// adds resilience
.UseResilienceOnStartup()
// use correlationid for http context
.UseCorrelationId(options => options.UseGuidForCorrelationId = true);
}
private async Task<string> GetWeatherForecast()
{
// inject IOptions<CorrelationIdOptions> correlationOptions
// creates a parent activity context...
var activity = new Activity("CallToBackend")
.AddBaggage(_correlationOptions.Header, Guid.NewGuid().ToString())
.Start();
try
{
return await _httpClient.GetStringAsync(
"http://localhost:5000/weatherforecastproxy");
}
finally
{
activity.Stop();
}
}