Skip to content

Commit

Permalink
Merge pull request #68 from NerosoftDev/develop
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Codespilot authored Jan 17, 2024
2 parents 261f700 + b74e06c commit 9c55325
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Apache.NMS.ActiveMQ" Version="2.1.0" />
<PackageVersion Include="Autofac" Version="7.1.0" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Autofac" Version="8.0.0" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Autofac.Extras.DynamicProxy" Version="7.1.0" />
<PackageVersion Include="AutoMapper" Version="12.0.1" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.19.1" />
Expand Down Expand Up @@ -40,7 +40,7 @@
<PackageVersion Include="Serilog.Sinks.Elasticsearch" Version="9.0.3" />
<PackageVersion Include="Serilog.Sinks.Email" Version="2.4.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageVersion Include="StackExchange.Redis" Version="2.7.10" />
<PackageVersion Include="StackExchange.Redis" Version="2.7.17" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
Expand Down Expand Up @@ -130,7 +130,7 @@
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.13.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="xunit" Version="2.6.5" />
<PackageVersion Include="xunit" Version="2.6.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
6 changes: 4 additions & 2 deletions Source/Euonia.Mapping.Automapper/AutomapperModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ namespace Nerosoft.Euonia.Mapping;
/// </summary>
public class AutomapperModule : ModuleContextBase
{
private const string SERVICE_KEY = "automapper";

/// <inheritdoc />
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutomapper();
context.Services.TryAddSingleton<ITypeAdapterFactory, AutomapperTypeAdapterFactory>();
context.Services.TryAddKeyedSingleton<ITypeAdapterFactory, AutomapperTypeAdapterFactory>(SERVICE_KEY);
}

/// <inheritdoc />
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var factory = context.ServiceProvider.GetService<ITypeAdapterFactory>();
var factory = context.ServiceProvider.GetKeyedService<ITypeAdapterFactory>(SERVICE_KEY);
if (factory != null)
{
TypeAdapterFactory.SetCurrent(factory);
Expand Down
6 changes: 4 additions & 2 deletions Source/Euonia.Mapping.Mapster/MapsterModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ namespace Nerosoft.Euonia.Mapping;
/// </summary>
public class MapsterModule : ModuleContextBase
{
private const string SERVICE_KEY = "mapster";

/// <inheritdoc />
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddMapster();
context.Services.TryAddSingleton<ITypeAdapterFactory, MapsterTypeAdapterFactory>();
context.Services.TryAddKeyedSingleton<ITypeAdapterFactory, MapsterTypeAdapterFactory>(SERVICE_KEY);
}

/// <inheritdoc />
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var factory = context.ServiceProvider.GetService<ITypeAdapterFactory>();
var factory = context.ServiceProvider.GetKeyedService<ITypeAdapterFactory>(SERVICE_KEY);
if (factory != null)
{
TypeAdapterFactory.SetCurrent(factory);
Expand Down
2 changes: 1 addition & 1 deletion project.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>8.1.17</Version>
<Version>8.1.18</Version>
<Authors>damon</Authors>
<Company>Nerosoft Ltd.</Company>
<Product>Euonia</Product>
Expand Down

0 comments on commit 9c55325

Please sign in to comment.