if (gardenvlist.Count() == getava.Count())
{
}
else if(oceanvlist.Count() == getava.Count())
{
}
else if (cityvlist.Count() == getava.Count())
{
}
<
There is another overload of Count() that takes a lambda expression as a parameter where you can filter elements to count from the source collection.
Say you have a list of strings like this:
var list = new List() {
"a",
"b",
"c",
"aa",
"bbb"
};
Then you can use it like this:
var countSingles = list.Count(str => str.Length == 1);
This will count the elements of the list with length 1, so here it would return 3.