C#, get all collection properties from an object
Posted
by Eatdoku
on Stack Overflow
See other posts from Stack Overflow
or by Eatdoku
Published on 2010-06-11T16:12:11Z
Indexed on
2010/06/11
16:22 UTC
Read the original article
Hit count: 170
Hi,
I have a class with 3 List collections like the following.
I am trying to have a logic which will iterate through the object's "collection" properties and do some operation using the data stored in those collections.
I am just wondering if there is an easy way of doing it using foreach. thanks
public class SampleChartData
{
public List<Point> Series1 { get; set; }
public List<Point> Series2 { get; set; }
public List<Point> Series3 { get; set; }
public SampleChartData()
{
Series1 = new List<Point>();
Series2 = new List<Point>();
Series3 = new List<Point>();
}
}
© Stack Overflow or respective owner