Resolved #4630: Add AutoMapper to the Application.Contracts package to allow to use AutoMap attributes on the DTOs

pull/4633/head
Halil İbrahim Kalkan 5 years ago
parent 9f2a89a5a8
commit 0a202c4b46

@ -13,6 +13,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.ObjectExtending\Volo.Abp.ObjectExtending.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Application.Contracts\Volo.Abp.Account.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application.Contracts\Volo.Abp.PermissionManagement.Application.Contracts.csproj" />

@ -1,4 +1,5 @@
using Volo.Abp.Account;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
@ -15,7 +16,8 @@ namespace MyCompanyName.MyProjectName
typeof(AbpIdentityApplicationContractsModule),
typeof(AbpPermissionManagementApplicationContractsModule),
typeof(AbpTenantManagementApplicationContractsModule),
typeof(AbpObjectExtendingModule)
typeof(AbpObjectExtendingModule),
typeof(AbpAutoMapperModule)
)]
public class MyProjectNameApplicationContractsModule : AbpModule
{
@ -23,5 +25,13 @@ namespace MyCompanyName.MyProjectName
{
MyProjectNameDtoExtensions.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<MyProjectNameApplicationContractsModule>();
});
}
}
}

Loading…
Cancel
Save