/// <summary> /// 修改实体 /// </summary> /// <param name="input"></param> /// <returns></returns> protected virtual async Task UpdateMenuPermissionAsync(CreateOrUpdateMenuPermissionInput input) { Debug.Assert(input.MenuPermission.Id != null, "input.MenuPermission.Id should be set."); var menuPermission = input.MenuPermission.MapTo<AuthorityMenuPermissionInfo>(); await _menuPermissionRepository.UpdateAsync(menuPermission); cacheHandler.Remove(CacheCategoryMenuPermission, "GetMenuPermissionList"); }
/// <summary> /// 创建实体 /// </summary> /// <param name="input"></param> /// <returns></returns> protected virtual async Task CreateMenuPermissionAsync(CreateOrUpdateMenuPermissionInput input) { var menuPermission = input.MenuPermission.MapTo<AuthorityMenuPermissionInfo>(); menuPermission.Id = GuidHelper.NewGuid(); await _menuPermissionRepository.InsertAsync(menuPermission); cacheHandler.Remove(CacheCategoryMenuPermission, "GetMenuPermissionList"); }
/// <summary> /// 添加修改实体 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task CreateOrUpdateMenuPermission(CreateOrUpdateMenuPermissionInput input) { if (input.MenuPermission.Id != null && input.MenuPermission.Id != Guid.Empty) { await UpdateMenuPermissionAsync(input); } else { await CreateMenuPermissionAsync(input); } }