/// <summary>
        /// 新增\修改
        /// </summary>
        /// <param name="Dto"></param>
        /// <returns></returns>
        public async Task <Guid> SaveAsync(Sys_RoleMenuFunctionDto Dto)
        {
            var RoleId      = Dto.RoleId;
            var MenuId      = Dto.MenuId;
            var FunctionIds = Dto.FunctionIds;

            await this.DeleteAsync(w => w.RoleMenuFunction_RoleID == RoleId& w.RoleMenuFunction_MenuID == MenuId);

            foreach (var item in Dto.FunctionIds)
            {
                var model = new Sys_RoleMenuFunction();
                model.RoleMenuFunction_MenuID     = MenuId;
                model.RoleMenuFunction_RoleID     = RoleId;
                model.RoleMenuFunction_FunctionID = item;

                await this.InsertAsync(model);
            }

            return(RoleId);
        }
示例#2
0
 public async Task <ApiResult> SaveAsync([FromBody] Sys_RoleMenuFunctionDto Model)
 => this.ResultOk(await this.service.SaveAsync(Model));