| 12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Reflection;
- using Abp.Authorization;
- using Abp.AutoMapper;
- using Abp.Modules;
- using Abp.Notifications;
- using WePlatform.BaseSystem.Notifications.Dto;
- using IwbZero.Authorization.Base.Permissions;
- using WePlatform.WeBase;
- using WePlatform.WeBase.BehaviorRole.Dto;
- namespace WePlatform
- {
- [DependsOn(typeof(WePlatformCoreModule), typeof(AbpAutoMapperModule))]
- public class WePlatformApplicationModule : AbpModule
- {
- public override void PreInitialize()
- {
- }
- public override void Initialize()
- {
- IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
- // TODO: Is there somewhere else to store these, with the dto classes
- Configuration.Modules.AbpAutoMapper().Configurators.Add(cfg =>
- {
- // Role and permission
- cfg.CreateMap<Permission, string>().ConvertUsing(r => r.Name);
- cfg.CreateMap<PermissionSetting, string>().ConvertUsing(r => r.Name);
- cfg.CreateMap<NotificationDefinition, NotificationSubscriptionWithDisplayNameDto>();
- //cfg.CreateMap<BehaviorRoleInfo, BehaviorRoleDto>().ForMember(a=>a.SceneCategoryName,o=>o.MapFrom(a=>a.SceneCategoryInfo != null ? a.SceneCategoryInfo.CategoryName : ""));
- });
- }
- }
- }
|