, .
, , serlizating . , , .
var type = myObjectOfSomeType.GetType();
var properties = type.GetProperties();
foreach(var p in properties)
{
var value = p.GetValue(myObjectOfSomeType, null);
Writevalue(p.Name, value);
}
WriteValue , , string, char, integer, double, DateTime ..
- , , , , .
However, I recommend looking at WCF, and not at creating services, but at serialization. It comes as part of the .NET 3.0 platform with the new System.Runtime.Serilization assembly and is generally very capable of handling serialization and data annotations.
source
share