generated from giis-uniovi/samples-giis-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add tdrules cache * Optimize IT runtime * Final review
- Loading branch information
1 parent
88e64d2
commit 276d50b
Showing
26 changed files
with
549 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
target | ||
.tdrules-cache | ||
pom.xml.versionsBackup | ||
TESTS-TestSuites.xml | ||
dependency-reduced-pom.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
net/QACover/Giis.Tdrules.Model.IO/ModelJsonSerializer.N.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace Giis.Tdrules.Model.IO | ||
{ | ||
// Temporal location, to be moved to tdrules-model | ||
public class ModelJsonSerializer | ||
{ | ||
/// <summary>Recommended serialization for models (exclude null and empty attributes)</summary> | ||
public string Serialize(object model, bool prettyPrint) | ||
{ | ||
JsonSerializerSettings settings = new JsonSerializerSettings | ||
{ | ||
NullValueHandling = NullValueHandling.Ignore | ||
}; | ||
JsonSerializer serializer = new JsonSerializer(); | ||
string result = JsonConvert.SerializeObject(model, prettyPrint ? Formatting.Indented : Formatting.None, settings); | ||
return result; | ||
} | ||
|
||
/// <summary>Recommended deserialization for models</summary> | ||
public object Deserialize(string json, Type clazz) | ||
{ | ||
return JsonConvert.DeserializeObject(json, clazz); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.