Skip to content

Commit

Permalink
Merge pull request #64 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
update packages
  • Loading branch information
Ali-YousefiTelori authored Dec 4, 2023
2 parents b7e9d92 + c11d2b4 commit 4fc1298
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.4</Version>
<Version>0.0.0.8</Version>
<Description>Serialize and deserialize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serialize,deserialize</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.3</Version>
<Version>0.0.0.8</Version>
<Description>Serialize and deserialize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serialize,deserialize</PackageTags>
Expand All @@ -26,11 +26,11 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>.\bin\$(Configuration)\$(TargetFramework)\EasyMicroservices.Serialization.DependencyInjection.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\EasyMicroservices.Serialization\EasyMicroservices.Serialization.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using EasyMicroservices.Serialization.Interfaces;
using EasyMicroservices.Serialization.Options;

namespace Microsoft.Extensions.DependencyInjection
Expand All @@ -18,11 +19,52 @@ public static class SerializationExtensions
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddSerialization(this IServiceCollection services, Action<SerializationOption> options)
{
return AddSerializationTransient(services, options);
}

/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddSerializationTransient(this IServiceCollection services, Action<SerializationOption> options)
{
options.ThrowIfNull(nameof(options));
options(new SerializationOption());
services.AddTransient<ITextSerializationProvider>(service => SerializationOptionBuilder.GetTextSerialization());
services.AddTransient<IBinarySerializationProvider>(service => SerializationOptionBuilder.GetBinarySerialization());
return services;
}

/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddSerializationScoped(this IServiceCollection services, Action<SerializationOption> options)
{
options.ThrowIfNull(nameof(options));
options(new SerializationOption());
services.AddScoped<ITextSerializationProvider>(service => SerializationOptionBuilder.GetTextSerialization());
services.AddScoped<IBinarySerializationProvider>(service => SerializationOptionBuilder.GetBinarySerialization());
return services;
}

/// <summary>
///
/// </summary>
/// <param name="services"></param>
/// <param name="options"></param>
/// <returns></returns>
public static IServiceCollection AddSerializationSingleton(this IServiceCollection services, Action<SerializationOption> options)
{
options.ThrowIfNull(nameof(options));
options(new SerializationOption());
services.AddScoped(service => SerializationOptionBuilder.GetTextSerialization());
services.AddScoped(service => SerializationOptionBuilder.GetBinarySerialization());
services.AddSingleton<ITextSerializationProvider>(service => SerializationOptionBuilder.GetTextSerialization());
services.AddSingleton<IBinarySerializationProvider>(service => SerializationOptionBuilder.GetBinarySerialization());
return services;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.4</Version>
<Version>0.0.0.8</Version>
<Description>Serialize and deserialize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serialize,deserialize</PackageTags>
Expand All @@ -28,7 +28,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MemoryPack" Version="1.9.16" />
<PackageReference Include="MemoryPack" Version="1.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.4</Version>
<Version>0.0.0.8</Version>
<Description>Serilize and deserilize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serilize,deserilize</PackageTags>
Expand All @@ -28,6 +28,6 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\EasyMicroservices.Serialization\EasyMicroservices.Serialization.csproj" />
<PackageReference Include="MessagePack" Version="2.5.124" />
<PackageReference Include="MessagePack" Version="2.5.140" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.6</Version>
<Version>0.0.0.8</Version>
<Description>Serialize and deserialize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serialize,deserialize</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.7</Version>
<Version>0.0.0.8</Version>
<Description>Serialize and deserialize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serialize,deserialize</PackageTags>
Expand All @@ -28,7 +28,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="7.0.3" />
<PackageReference Include="System.Text.Json" Version="7.0.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EasyMicroservices.Serialization\EasyMicroservices.Serialization.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.4</Version>
<Version>0.0.0.8</Version>
<Description>Serialize and deserialize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serialize,deserialize</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@
</Choose>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Tests" Version="0.0.0.7" />
<PackageReference Include="EasyMicroservices.Tests" Version="0.0.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit.assert" Version="2.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.4</Version>
<Version>0.0.0.8</Version>
<Description>Serialize and deserialize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serialize,deserialize</PackageTags>
Expand All @@ -28,6 +28,6 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\EasyMicroservices.Serialization\EasyMicroservices.Serialization.csproj" />
<PackageReference Include="YamlDotNet" Version="13.3.1" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.4</Version>
<Version>0.0.0.8</Version>
<Description>Serialize and deserialize wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>Serialize,deserialize</PackageTags>
Expand All @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Utilities" Version="0.0.0.11" />
<PackageReference Include="EasyMicroservices.Utilities" Version="0.0.0.13" />
</ItemGroup>

</Project>

0 comments on commit 4fc1298

Please sign in to comment.