Skip to content

Commit

Permalink
Fix for values not being deserialized properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsoltGajdacs committed Mar 9, 2021
1 parent f4e80fa commit 9634379
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion UsageWatcher/Model/UsageModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using UsageWatcher.Enums;

namespace UsageWatcher.Model
Expand All @@ -14,5 +15,14 @@ public UsageModel(Resolution resolution, DateTime startTime)
StartTime = startTime;
EndTime = startTime + TimeSpan.FromMilliseconds((double)resolution);
}

[JsonConstructor]
[System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality",
"IDE0051:Remove unused private members", Justification = "Only for Json it is used")]
private UsageModel(DateTime startTime, DateTime endTime)
{
StartTime = startTime;
EndTime = endTime;
}
}
}

0 comments on commit 9634379

Please sign in to comment.