simplify tests
This commit is contained in:
parent
d835495591
commit
6ff8631121
|
@ -32,11 +32,13 @@ namespace EHEC_Server
|
|||
//// For parsing user defined class object
|
||||
//// To get all properties of object
|
||||
//// and then store object properties and their value in dictionary container
|
||||
var objectDataContainer = obj.GetType().GetProperties().ToDictionary(i => i.Name, i => i.GetValue(obj));
|
||||
var objectDataContainer = obj.GetType();
|
||||
var objectDataContainer1 = objectDataContainer.GetProperties();
|
||||
var objectDataContainer2 = objectDataContainer1.ToDictionary(i => i.Name, i => i.GetValue(obj));
|
||||
|
||||
StringBuilder jsonfile = new StringBuilder();
|
||||
jsonfile.Append("{");
|
||||
foreach (var data in objectDataContainer)
|
||||
foreach (var data in objectDataContainer2)
|
||||
{
|
||||
jsonfile.Append($"\"{data.Key}\":{Serialize(data.Value)},");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue