public async Task <OperationResponse> AllocationRoleMenuAsync(RoleMenuInputDto dto) { dto.NotNull(nameof(dto)); return(await _roleMenuRepository.UnitOfWork.UseTranAsync(async() => { await _roleMenuRepository.DeleteBatchAsync(x => x.RoleId == dto.Id); await _roleMenuRepository.InsertAsync(dto.MenuIds.Select(x => new RoleMenuEntity { RoleId = dto.Id, MenuId = x, }).ToArray()); return new OperationResponse(ResultMessage.AllocationSucces, OperationEnumType.Success); })); }
public async Task <AjaxResult> AllocationRoleMenuAsync([FromBody] RoleMenuInputDto dto) { return((await _roleContract.AllocationRoleMenuAsync(dto)).ToAjaxResult()); }