public FunctionalityAppRoleAddVM ToFunctionalityAppRoleAddVM(AppRole role)
        {
            FunctionalityAppRoleAddVM result = new FunctionalityAppRoleAddVM()
            {
                RoleId   = role.Id,
                RoleName = role.Name
            };

            return(result);
        }
Exemple #2
0
        public FunctionalityAppRoleAddVM GetFunctionalityAppRoleAddVM(int roleId)
        {
            AppRole role = AppRoleRepository.GetSingle(x => x.Id == roleId);

            if (role.AppRoleType == AppRoleType.Administrator)
            {
                throw new BussinesException(3, ErrorResource.CanNotAddFunctionalityToAdminRole);
            }
            FunctionalityAppRoleAddVM result = FunctionalityAppRoleConverter.ToFunctionalityAppRoleAddVM(role);

            return(result);
        }