I have the following select which returns the 4 columns I want:
var allUsers = await dbContext.AppUsers
.Where(u => allUserIds.Contains(u.IdentityUsersId))
.Include(u => u.Following)
.Select(u => new
{
u.Name,
u.Email,
u.Phone!.FormattedNumber,
u.Following
})
.ToListAsync();
However Following
is a List<Organization>
. What I want is the Organization.Name
. Is there a way to have it, in the select, return a List<string>
?
And if so, is there a way to instead of it being a List<string>
, it can be a string
that is a string.Join()
of all the names?