I have this array:
var categoryGroups = new[] {
new CategoryGroupSource { Id = 1, Name = "Conversation" },
new CategoryGroupSource { Id = 2, Name = "Business" },
new CategoryGroupSource { Id = 3, Name = "Education" }
};
I tried to do a count on this:
categoryGroups.Count
But it is giving me an error saying this will only work with a list. Can someone give me advice on this?
Note I am also doing this:
foreach (CategoryGroupSource categoryGroup in categoryGroups)
{
db.Insert(categoryGroup);
}
Does the foreach work for arrays and lists?