/// <summary> /// 异步获取代理 /// </summary> public async Task <AgentDto> GetAgentByIdAsync(Guid agentId) { var agent = await AgentRepository.FindAsync(agentId); var result = agent.ToDto(); if (agent.ParentId != null) { var parentAgent = await AgentRepository.FindAsync(agent.ParentId); result.ParentName = parentAgent.Name; } return(result); }