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().ConvertUsing(r => r.Name); cfg.CreateMap().ConvertUsing(r => r.Name); cfg.CreateMap(); //cfg.CreateMap().ForMember(a=>a.SceneCategoryName,o=>o.MapFrom(a=>a.SceneCategoryInfo != null ? a.SceneCategoryInfo.CategoryName : "")); }); } } }