+36
Planned
peter molyneux 6 years ago in Feature Requests • updated by Omer Raviv (CTO) 1 year ago 23

I have often wanted a feature that I never found. This tool could include it.


When debugging and looking att an object. I would like to be able to serialize it, or save it... in a way that I then could load it in at a later time.

This could have many advantages. Mainly, when creating a test, this could be an easy way to create Mock-data.

Often I'm in a situation where a function failes for some input. I set a breakpoint, find the problem and fix it. But I would like to create a test that verifies that this works in the future. But creating a test is a big task since I manually have to create the objects that the function needs as input. If I could simply save the object when debugging... I would be laughing :D
So if I want to make a test that verifies a functions output given certain objects as input, this could be done with grea

Answer

Answer

The Export feature is now available as part of the the OzCode Early Access Preview which fixes many bugs that were found in the previous beta. Please try out the latest EAP and let us know what you think!

Under review
Interesting idea. We'll consider to add it. Please upvote if you like it.
Just to support the case I'd like to mention that this feature would also be extremely helpful when comparing the behaviour of two different versions of a product. I recently had the case when some feature worked in one version but failed in another. To find the problem I had to print out an object structure and compare it manually. With an export a diff tool would have done the work more efficient.
Also in support for this ... I often have to debug complex objects where expanding individual properties is a pain. Also the values shown tend to include private values etc, masking what you want to see. A simple JSON visualizer would be great, just public properties would do me fine (I personally don't need to deserialize). This is probably not that difficult to do as a visualizer, but to do it within OzCode seems to make sense.
Thanks a lot for your feedback, Russell! I just want to make sure I fully understand your needs here - do you want to be able to save the state of a complex object in order to be able to compare to it later, or are you saying that you'd like to see your objects in a broader view, as request here and the linked stackoverflow thread?
As for me I'd really like to save the serialization to a file (e.g. JSON) and then use a diff tool to compare two files (= states of the same object) in order to see what has changed.
+3
Sorry for delay in replying.

I'm looking for something very simple, just showing a JSON text output for a given object (public properties only). I'm not looking for another hierarchical view, I think the current windows do a great job of that already.

Imagine you have a complex hierarchical object and you just want an overview, see how its made up and what it looks like with 'real' values. Sometimes its easier to see this as text than it is to drill into properties (even with the great search capabilities of OzCode). Below I have an example of some JSON. Imaging viewing the object for this in the watch window for example, drilling down through properties and collections. While complex, its easier to see how things fit together as a textural representation.

Thanks
Russell
(not sure how to format the JSON here but you get the idea!).


{
"Status" : "InProgress",
"Reference" : null,
"SaleId" : 0,
"RenewalType" : "Automatic",
"Term" : {
"Unit" : "Months",
"TermLength" : 12
},
"ContactId" : 5565450,
"SalesOwner" : {
"Email" : "user2326@test.com",
"FullName" : "Test2326 User",
"IsActive" : true,
"Links" : [{
"rel" : "GetEmployee",
"href" : "http://somehost/api/Sales/Employee/2326"
}
]
},
"Agreements" : [{
"Status" : "Draft",
"RenewalSource" : "Automatic",
"OverrideType" : "None",
"StartDate" : "2015-03-01T00:00:00",
"EndDate" : "2015-05-31T00:00:00",
"IsPreferred" : true,
"CommissionTier" : 1,
"EmployeeId" : 0,
"Retainer" : 0,
"Inventories" : [{
"InventoryUsageId" : 452838,
"InventoryName" : "3.1",
"ProductId" : "a0801e8a-f874-49b4-a7f9-808be5e69028",
"ProductSubTypeId" : 1030,
"PreviousInventorySaleId" : 11260933,
"PreviousInventoryUsageId" : 452838,
"PreviousInventoryName" : "3.1",
"Occupants" : 2,
"Prices" : [{
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 2200,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 2200,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
}, {
"Type" : "Renewal",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1449,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 0,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
}, {
"Type" : "Override",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1449,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1000,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
}, {
"Type" : "Previous",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1397,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1397,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
}
],
"Links" : [{
"rel" : "GetProduct",
"href" : "http://somehost/api/Products/a0801e8a-f874-49b4-a7f9-808be5e69028"
}, {
"rel" : "GetProductSubType",
"href" : "http://somehost/api/Products/a0801e8a-f874-49b4-a7f9-808be5e69028/1030"
}
]
}
],
"Offers" : [
],
"BreakClauses" : [],
"AgreementCommissionSummary" : {
"CommissionTier" : {
"Name" : "Tier 3",
"Order" : 3,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1845,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1845,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
},
"CommissionTerms" : [{
"Name" : null,
"MininumTerm" : 0,
"MaximumTerm" : 3,
"CommissionTiers" : [{
"Name" : "Tier 1",
"Order" : 1,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1879,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1879,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 2",
"Order" : 2,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1862,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1862,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 3",
"Order" : 3,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1845,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1845,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}
]
}, {
"Name" : null,
"MininumTerm" : 3,
"MaximumTerm" : 6,
"CommissionTiers" : [{
"Name" : "Tier 1",
"Order" : 1,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1879,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1879,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 2",
"Order" : 2,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1763,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1763,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 3",
"Order" : 3,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1747,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1747,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}
]
}, {
"Name" : null,
"MininumTerm" : 6,
"MaximumTerm" : 12,
"CommissionTiers" : [{
"Name" : "Tier 1",
"Order" : 1,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1779,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1779,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 2",
"Order" : 2,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1545,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1545,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 3",
"Order" : 3,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1531,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1531,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}
]
}, {
"Name" : null,
"MininumTerm" : 12,
"MaximumTerm" : 18,
"CommissionTiers" : [{
"Name" : "Tier 1",
"Order" : 1,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1559,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1559,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 2",
"Order" : 2,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1436,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1436,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 3",
"Order" : 3,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1423,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1423,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}
]
}, {
"Name" : null,
"MininumTerm" : 18,
"MaximumTerm" : 24,
"CommissionTiers" : [{
"Name" : "Tier 1",
"Order" : 1,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1449,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1449,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 2",
"Order" : 2,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1396,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1396,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 3",
"Order" : 3,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1383,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1383,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}
]
}, {
"Name" : null,
"MininumTerm" : 24,
"MaximumTerm" : 9999,
"CommissionTiers" : [{
"Name" : "Tier 1",
"Order" : 1,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1409,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1409,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 2",
"Order" : 2,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1396,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1396,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}, {
"Name" : "Tier 3",
"Order" : 3,
"Amount" : {
"Type" : "List",
"BeforeTax" : 0,
"Tax" : 0,
"Total" : 0,
"TotalDiscount" : 0,
"UnitPrice" : 1383,
"UnitDiscount" : 0,
"Currency" : {
"Id" : 472,
"Code" : "GBP",
"Name" : "British Pounds",
"Symbol" : "£",
"Links" : [{
"rel" : "GetCurrency",
"href" : "http://somehost/api/Currencies/GBP"
}
]
},
"HighestMonthlyPrice" : 1383,
"ProratedValue" : 0,
"IsStepDiscounted" : false,
"Step" : null
},
"DiscountRatio" : 0
}
]
}
]
}
}
],
"Links" : [{
"rel" : "GetContactById",
"href" : "http://somehost/api/Contact/5565450"
}
]

}
+1

This sounds like a great idea!

+2

The next version of OzCode will feature an "Export" feature, allowing the user to take any object and serialize it to a file. Currently there are 4 formats planned: XML, JSON, C#, and Excel. Please let us know if there are additional formats you would like to see supported!

+1

That's great!


And if somebody needs other formats, they can convert it.

+1

That looks like an awesome extension, Omar! Thanks for sharing it.

+1

Cool. #UserDrivenDevelopment :-)

Hi guys,

I just installed the beta and already have my firsts impressions.

  • Exporting in JSON was everything OK.
  • In C#: I have one object with a list of 10k objects, I was hopping to get all 10k objects however I just got 500 and before you ask me yes I saved to a file to get all code. The window ("Export Results") doesn't tell me that I will get only the first 500 objects not 10.000.
  • In this list we use Enum's, but in the export to C# code, they was ignored and place like a text.

This was my first impressions, I hope to get more in the near future.

Thank you very much for the report! We will investigate these issues and give you a heads-up when the next update of the beta is released.

The Export feature is now available as part of the public v2.1 beta.

You can export any object or collection to C# / XML / Json (in Json.NET format), and you can also export any collection to Excel.


For more details, see the announcement blog post.

Answer

The Export feature is now available as part of the the OzCode Early Access Preview which fixes many bugs that were found in the previous beta. Please try out the latest EAP and let us know what you think!

I like it!


The dark theme looks a little jarring. I get dark blue and green text on a black background, not easy to see.


Also, sometimes I get type information...

{

"$type": "My.Thing",
"$tostring": "My.Thing",

"OrganizationId": 501,
"Slug": "my-slug",

"Footer": "Footer Details",
"Steps": {

...


I know this is a feature of Json.net, It doesn't always show so do you set this or is it being taken from the global settings, i.e. can I influence it as I don't need this information?

Thanks for the feedback, Russell! We realize the colors of the text foreground in Dark Theme need to be improved, and will take care of it before the official release.


Yes, those $tostring and $type members are something that OzCode adds on purpose to give you extra information. We'll consider adding checkboxes to remove those in case you don't want them. In any case, they shouldn't prevent Json.NET from properly deserializing this output.

Great extension, happy to have it! :-)


However, the checkboxes for "Include fully qualyfied type names" and "Include private and protected members" seem to be mapped inversely. Behaviour for both checkboxes is the same, so here some reproduction steps for the first case:


  • Initially the checkbox for type inclusion is unchecked
  • Checking it does not change anything
  • Unchecking it again shows the type information

Thanks a lot for the report, Axel :). This is a known issue and will be fixed in an update that's coming soon.

There are a few more known issues that were kindly documented by a community member here: http://www.jugglingsource.de/blog/ozcodes-export-objects-feature-a-first-review-1/

Hi Axel, just wanted to give you an update that this is fixed in the OzCode Early Access Preview.