| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using System.Reflection;
- using Abp.Authorization;
- using Abp.AutoMapper;
- using Abp.Modules;
- using Abp.Notifications;
- using WeApp.BaseSystem.Notifications.Dto;
- using IwbZero.Authorization.Base.Permissions;
- namespace WeApp
- {
- [DependsOn(
- typeof(WeAppDataModule),
- typeof(AbpAutoMapperModule)
- )]
- public class WeAppApplicationModule : 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 : ""));
- });
- }
- }
- }
|