When to Use Properties & When to Use Methods?
- by DaveDev
Hi Guys
I was looking at the following line of code
foreach (PropertyInfo prop in t.GetProperties())
and I noticed that tprovides a method to return the type's properties instead of a property like
t.Properties
This makes me wonder why sometimes people use properties to make a type's data avilable and other times there's a method provided? Is there some logic behind the decision?
Thanks
Dave