views:

15

answers:

1

Hey All,

I have decided to use SubSonic (v3.0) for the first time and thoroughly enjoy it so far however I seem to have stumbled and I am hoping there is a nice neat solution.

I have a users, roles and joining table.

SubSonic (ActiveRecord) generated an entity User for my users table. A property of User is UserRoles and is of the type IQueryable this is my joining table.

I want to convert the IQueryable column name RoleName to a string array.

I have only just started playing with Linq as well and know of ToArray() but seem to be missing something or this isn't the function I want.

I could iterate over each item in the UserRoles property but seems a little excessive.

I appreciate your help! Cheers.

+2  A: 

Try

something.Select(r => r.RoleName).ToArray()
SLaks
Cheers, I knew I had over looked something here your code works :)
Daniel Draper