Esempio n. 1
0
        public void Execute(ModifyRoleFuncLinkCommand command)
        {
            Role role = _roleRepository.GetById(command.Id);

            role.RemoveAllFunc();
            command.FidList.ForEach(f =>
            {
                if (!role.Funcs.Exists(ff => ff.Fid == f))
                {
                    role.AddFunc(f);
                }
            });
            _roleRepository.SaveChange(role);
            command.Result.Status = true;
        }