You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I sometimes use ObjectDumper to create unit test data for my software. In some cases I am dumping an object that has many children (with children) and I want to exclude properties of these children. I know you can exclude properties of the object you're dumping but I don't see a way to do it for the object's children. I propose adding an [ExcludeFromObjectDumper] attribute that can be placed on the properties I want excluded from the dump. I have already made these modifications and added tests to support them in my fork of the project.
API Changes
Add an ExcludeFromObjectDumper attribute.
[System.AttributeUsage(System.AttributeTargets.Property)]
public class ExcludeFromObjectDumperAttribute : System.Attribute
{
}
In ObjectDumperCSharp.cs change the GetPropertiesToDump method:
Summary
I sometimes use ObjectDumper to create unit test data for my software. In some cases I am dumping an object that has many children (with children) and I want to exclude properties of these children. I know you can exclude properties of the object you're dumping but I don't see a way to do it for the object's children. I propose adding an [ExcludeFromObjectDumper] attribute that can be placed on the properties I want excluded from the dump. I have already made these modifications and added tests to support them in my fork of the project.
API Changes
Add an ExcludeFromObjectDumper attribute.
In ObjectDumperCSharp.cs change the GetPropertiesToDump method:
In ObjectDumperConsole.cs change the CreateObject method:
Intended Use Case
This proposal is useful if you are dumping objects that have nested objects and you want properties excluded from the nested objects.
The text was updated successfully, but these errors were encountered: