BlazorApp/BlazorApp.Client/Extensions.cs

20 lines
581 B
C#

using BlazorApp.Client.Interfaces;
using BlazorApp.Client.Proxies;
namespace BlazorApp.Client
{
public static class Extensions
{
public static IServiceCollection AddClientServices(this IServiceCollection services)
{
services.AddScoped<ICustomerProxy, CustomerProxy>();
services.AddSingleton<WeatherForecastService>();
services.AddHttpClient("BlazorAppAPI", client =>
{
client.BaseAddress = new Uri("https://localhost:7018/");
});
return services;
}
}
}