/// <summary> /// 修改 /// </summary> /// <param name="id">部门id</param> /// <param name="branchName">部门名称</param> /// <returns></returns> public async Task EditBranch(Guid id, string branchName) { using BranchService branchService = new BranchService(); if (await branchService.GetAllAsync().AnyAsync(i => i.Id == id)) { var branch = branchService.GetAllAsync().FirstOrDefault(i => i.Id == id); if (branch != null) { branch.BranchName = branchName; } await branchService.EditAsync(branch); } }