protected override async Task ActionAsync() { if (string.IsNullOrEmpty(Input.UserId)) { throw new NotAuthentifiedException(); } var user = await _userService.FindApplicationUserByIdAsync(Input.UserId); var getSites = new List <GetSitesResult>(); foreach (var role in user.Roles) { if (UserSecurity.IsSiteId(role)) { var itemDataModel = await _dataFactory.ItemRepository.GetItemAsync(null, role); if (itemDataModel != null) { var sitemap = await SiteMap.SitemapUrlAsync(itemDataModel, _dataFactory, _routeManager); getSites.Add(new GetSitesResult { SiteId = itemDataModel.Id, Url = sitemap.BaseUrl }); } } } var getUserResult = new GetUserResult(); getUserResult.GetSites = getSites; Result.Data = getUserResult; }