21 lines
596 B
C#
21 lines
596 B
C#
using Hncore.Infrastructure.Extension;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace PaymentCenterClient
|
|
{
|
|
public static class IServiceCollectionExtension
|
|
{
|
|
public static void AddPaymentCenterClient(this IServiceCollection service, string baseUrl = "")
|
|
{
|
|
if (!baseUrl.Has())
|
|
{
|
|
baseUrl = "http://paymentcenter/";
|
|
}
|
|
|
|
PaymentCenterHttpClient._BaseUrl = baseUrl;
|
|
|
|
service.AddHttpClient();
|
|
service.AddSingleton<PaymentCenterHttpClient>();
|
|
}
|
|
}
|
|
} |