public class MyEntity : TableEntity
{
public string MyProperty { get; set; }
[IgnoreProperty]
public string MyIgnoredProperty { get; set; }
public override string ToString()
{
Stateprinter printer = new Stateprinter();
return printer.PrintObject(this);
}
}
尽管这对于任何种类的类都非常有效,但使用此MyEntity类,它还会打印MyIgnoredProperty。打印出对象时,是否有聪明的方法也可以忽略具有[IgnoredProperty]作为属性的属性?
我正在尝试打印出实现TableEntity类的对象,而没有那些关于持久性应该被忽略的对象。我通常用于打印对象的方法是使用...
Stateprinter
来配置"field harvester"关心的字段/属性。