Skip to content

Commit f40231d

Browse files
committed
#94: removed unnecessary mapping
1 parent 46c8ba1 commit f40231d

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/AbpCompanyName.AbpProjectName.Application/AbpProjectNameApplicationModule.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,7 @@ public override void Initialize()
3232

3333
cfg.CreateMap<CreateRoleDto, Role>().ForMember(x => x.Permissions, opt => opt.Ignore());
3434
cfg.CreateMap<RoleDto, Role>().ForMember(x => x.Permissions, opt => opt.Ignore());
35-
36-
IRepository<Role, int> repository = IocManager.Resolve<IRepository<Role, int>>();
37-
// User and role
38-
cfg.CreateMap<UserRole, string>().ConvertUsing((r) => {
39-
//TODO: Fix, this seems hacky
40-
Role role = repository.FirstOrDefault(r.RoleId);
41-
return role.DisplayName;
42-
});
43-
44-
IocManager.Release(repository);
45-
35+
4636
cfg.CreateMap<UserDto, User>();
4737
cfg.CreateMap<UserDto, User>().ForMember(x => x.Roles, opt => opt.Ignore());
4838

0 commit comments

Comments
 (0)