i have this entity called BlogArticle which has a property called
public virtual ICollection<BlogComment> BlogComments { get; set; }
what i wanna do is access those properties of the blogcomments in my view but since it is in a ICollection i cannot itterate through it. (.count() does work.)
Any suggestions on this matter?
cheers.
You can enumerate the collection by using a
foreachloop. If you need random access to the elements of the collection you can use theToList()extension method. That will create a new list containing all the elements of the collection.or