public void Register(AgentInfo agentInfo) { _agentRepository.AddAsync(new AgentEntity { //AgentId = 0, AgentUrl = agentInfo.AgentAddress }); }
/// <summary> /// 创建代理 /// </summary> private async Task <Agent> AddAgent(Agent agent) { var maxCode = await AgentRepository.GetMaxCode(); agent.Init(); agent.SetCode(maxCode); agent.SetAgentPath(await GetCurrentAgentAsync()); await AgentRepository.AddAsync(agent); return(agent); }