My class has a bunch of nullable double properties. At run time some of them have 0 value and i am going to set them null before sending action. I know that we can use a foreach statement to iterate through a collection which has been placed inside a class so i hope use the same technique for this problem. As i said in this case i am not working with a collection so Implementing the IEnumerable is a kind of meaningless idea. Is there any way to move among the members of class ?
I have tried this
Class1 c=new Class1(){Age = 12,Family = "JR",Name = "MAX"};
foreach (string member in c)
{
Console.WriteLine(member);
}
Console.ReadKey();
Implementing the IEnumerable
public IEnumerator GetEnumerator()
{
// ?!
}