public async Task OnGetAsync(int id = 0) { if (id != 0) { Agent = (await _agent.GetModelAsync(m => m.Id == id)).data; Agent.LoginName = (await _admin.GetModelAsync(m => m.Guid == Agent.Admin_Guid)).data.LoginName; } else { Agent = new CmsAgent(); } Levels = (await _level.GetListAsync()).data; }
public async Task <IActionResult> GetAgentbyGuid([FromBody] ParmString obj) { var guid = obj.parm; return(Ok((await agentService.GetModelAsync(t => t.Admin_Guid == guid)).data)); }