Skip to content

Commit ddfddc7

Browse files
committed
optionsProvider added.
1 parent 9def864 commit ddfddc7

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

FmgLib.HttpClientHelper/FmgLib.HttpClientHelper.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageId>FmgLib.HttpClientHelper</PackageId>
99
<Summary>It is a library that offers you dynamism for the HttpClient service and contains methods that parse the returned response to the model you want.</Summary>
1010
<Title>FmgLib.HttpClientHelper</Title>
11-
<Version>1.0.4</Version>
11+
<Version>1.1.0</Version>
1212
<Authors>FmgYazılım</Authors>
1313
<Company>Fmg Yazılım</Company>
1414
<Copyright>©2024</Copyright>
@@ -18,10 +18,10 @@
1818
<PackageTags>HttpClient, Client, Helper</PackageTags>
1919
<Description>It is a library that offers you dynamism for the HttpClient service and contains methods that parse the returned response to the model you want.</Description>
2020
<PackageIcon>nuget.png</PackageIcon>
21-
<AssemblyVersion>1.0.4</AssemblyVersion>
22-
<AssemblyFileVersion>1.0.4</AssemblyFileVersion>
23-
<PackageVersion>1.0.4</PackageVersion>
24-
<FileVersion>1.0.4</FileVersion>
21+
<AssemblyVersion>1.1.0</AssemblyVersion>
22+
<AssemblyFileVersion>1.1.0</AssemblyFileVersion>
23+
<PackageVersion>1.1.0</PackageVersion>
24+
<FileVersion>1.1.0</FileVersion>
2525
</PropertyGroup>
2626

2727
<ItemGroup>

FmgLib.HttpClientHelper/ServiceRegistration.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,16 @@ public static IServiceCollection AddFmgLibHttpClient(this IServiceCollection ser
1212

1313
return services;
1414
}
15+
16+
public static IServiceCollection AddFmgLibHttpClient(this IServiceCollection services, Func<JsonSerializerOptions> optionsProvider = null)
17+
{
18+
services.AddHttpClient();
19+
20+
if (optionsProvider != null)
21+
{
22+
SerializerSettings.Settings = optionsProvider();
23+
}
24+
25+
return services;
26+
}
1527
}

0 commit comments

Comments
 (0)