public async Task <List <long> > GetAvailableTownIdsAsync(ClaimsPrincipal user) { var vUser = await _userManager.GetUserAsync(user); if (vUser != null) { if (await _userManager.IsInRoleAsync(vUser, "TownManager")) { var townId = vUser.TownId; if (townId != null) { return(new List <long> { townId.Value }); } } else { return((await _townRepository.ListAllEagerAsync()).Select(t => t.Id).ToList()); } } return(new List <long>()); }