mirror of https://github.com/abpframework/abp.git
14 changed files with 68 additions and 18 deletions
@ -0,0 +1,20 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<Import Project="..\..\common.props" /> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netstandard2.0</TargetFramework> |
||||
|
<AssemblyName>Volo.Abp.ObjectMapping</AssemblyName> |
||||
|
<PackageId>Volo.Abp.ObjectMapping</PackageId> |
||||
|
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
||||
|
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
||||
|
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
||||
|
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
||||
|
<RootNamespace /> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,28 @@ |
|||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Volo.Abp.Modularity; |
||||
|
using Volo.Abp.Reflection; |
||||
|
|
||||
|
namespace Volo.Abp.ObjectMapping |
||||
|
{ |
||||
|
public class AbpObjectMappingModule : AbpModule |
||||
|
{ |
||||
|
public override void PreConfigureServices(IServiceCollection services) |
||||
|
{ |
||||
|
services.OnExposing(context => |
||||
|
{ |
||||
|
//Register types for IObjectMapper<TSource, TDestination> if implements
|
||||
|
context.ExposedTypes.AddRange( |
||||
|
ReflectionHelper.GetImplementedGenericTypes( |
||||
|
context.ImplementationType, |
||||
|
typeof(IObjectMapper<,>) |
||||
|
) |
||||
|
); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
public override void ConfigureServices(IServiceCollection services) |
||||
|
{ |
||||
|
services.AddAssemblyOf<AbpObjectMappingModule>(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue