public List<string> TagNameList (int objectId)
{
List<string> tagNameList = db.Tags.Where(ob => ob.Id == objectId).ToList();
}
db.Tags.Where(ob => ob.Id == objectId).ToList();
I'm going into the db
context in the Tags
and i select all the tags that have a set objectId
via a navigation property i have setup through an ObjectTags
table that stores the relationships in two columns, both make up a composite key.
The sample returns an IQueryable<app.Models.Tag>
. Is there any quick way to convert this to a List<string>
with just the Tag.Name
?