-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathServiceCollectionExtensions.cs
More file actions
41 lines (34 loc) · 1.48 KB
/
ServiceCollectionExtensions.cs
File metadata and controls
41 lines (34 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Contentstack.Management.Core;
using System.Net.Http;
using System;
namespace Microsoft.Extensions.DependencyInjection
{
public static class ServiceCollectionExtensions
{
/// <summary>
/// Adds Contentstack services to the IServiceCollection.
/// </summary>
/// <param name="services">The IServiceCollection.</param>
/// <param name="configuration">The ContentstackClientOptions used to retrieve configuration from.</param>
/// <returns>The IServiceCollection.</returns>
public static IServiceCollection AddContentstackClient(this IServiceCollection services, ContentstackClientOptions configuration)
{
return services;
}
/// <summary>
/// Adds Contentstack services to the IServiceCollection.
/// </summary>
/// <param name="services">The IServiceCollection.</param>
/// <param name="configuration">The IConfiguration used to retrieve configuration from.</param>
/// <returns>The IServiceCollection.</returns>
public static IServiceCollection TryAddContentstackClient(this IServiceCollection services, ContentstackClientOptions configuration)
{
return services;
}
public static IServiceCollection AddContentstackClient(this IServiceCollection services, Action<HttpClient> configureClient)
{
services.AddHttpClient<ContentstackClient>(configureClient);
return services;
}
}
}