diff --git a/Yavsc/ApiControllers/ChatApiController.cs b/Yavsc/ApiControllers/ChatApiController.cs index d3ef26c6..cd5e8779 100644 --- a/Yavsc/ApiControllers/ChatApiController.cs +++ b/Yavsc/ApiControllers/ChatApiController.cs @@ -24,7 +24,7 @@ namespace Yavsc.Controllers [HttpGet("users")] public IEnumerable GetUserList() { - + List result = new List(); var cxsQuery = dbContext.Connections?.Include(c=>c.Owner).GroupBy( c => c.ApplicationUserId ); // List result = new List(); @@ -37,12 +37,12 @@ namespace Yavsc.Controllers if (cxs.Count>0) { var user = cxs.First().Owner; - yield return new ChatUserInfo { UserName = user.UserName, + result.Add(new ChatUserInfo { UserName = user.UserName, UserId = user.Id, Avatar = user.Avatar, Connections = cxs, - Roles = ( userManager.GetRolesAsync(user) ).Result.ToArray() }; + Roles = ( userManager.GetRolesAsync(user) ).Result.ToArray() }); } } - + return result; } } }