-
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.
MetricDtos are now serializing all sub-properties to json
- Loading branch information
Showing
15 changed files
with
74 additions
and
41 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
GainsTracker.Common/Models/Generic/GenericJsonSerializer.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,16 @@ | ||
using System.Text.Json; | ||
|
||
namespace GainsTracker.Common.Models.Generic; | ||
|
||
public static class GenericJsonSerializer | ||
{ | ||
public static JsonDocument SerializeObjectToJson(object objectToSerialize) | ||
{ | ||
JsonSerializerOptions options = new() | ||
{ | ||
PropertyNameCaseInsensitive = true | ||
}; | ||
|
||
return JsonSerializer.SerializeToDocument(objectToSerialize, objectToSerialize.GetType(), options); | ||
} | ||
} |
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
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
10 changes: 10 additions & 0 deletions
10
GainsTracker.CoreAPI/Components/HealthMetrics/Services/Dto/CreateMetricDto.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,10 @@ | ||
using System.Text.Json; | ||
using GainsTracker.CoreAPI.Components.HealthMetrics.Models; | ||
|
||
namespace GainsTracker.CoreAPI.Components.HealthMetrics.Services.Dto; | ||
|
||
public class CreateMetricDto | ||
{ | ||
public MetricType Type { get; set; } | ||
public JsonDocument Data { get; set; } | ||
} |
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
5 changes: 2 additions & 3 deletions
5
GainsTracker.CoreAPI/Components/HealthMetrics/Services/IHealthMetricService.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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
using GainsTracker.CoreAPI.Components.HealthMetrics.Models; | ||
using GainsTracker.CoreAPI.Components.HealthMetrics.Services.Dto; | ||
|
||
namespace GainsTracker.CoreAPI.Components.HealthMetrics.Services; | ||
|
||
public interface IHealthMetricService | ||
{ | ||
void AddMetricToGainsAccount(string userHandle, MetricDto metricDto); | ||
List<Metric> GetAllMetricsByUsername(string currentUsername); | ||
void AddMetricToGainsAccount(string userHandle, CreateMetricDto createMetricDto); | ||
List<MetricDto> GetAllMetricsByUsername(string currentUsername); | ||
} |
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
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