parent
3b1c19fb9c
commit
d36bd18551
@ -0,0 +1,53 @@
|
|||||||
|
using Dto;
|
||||||
|
using Model;
|
||||||
|
using Shared;
|
||||||
|
|
||||||
|
namespace APIMappers;
|
||||||
|
|
||||||
|
public static class ActivityMapper
|
||||||
|
{
|
||||||
|
private static GenericMapper<Activity, ActivityDto> _mapper = new GenericMapper<Activity, ActivityDto>();
|
||||||
|
|
||||||
|
public static ActivityDto? ToDto(this Activity activity)
|
||||||
|
{
|
||||||
|
return activity.ToU(_mapper, activityDto => new ActivityDto
|
||||||
|
{
|
||||||
|
Id = activity.Id,
|
||||||
|
Type = activity.Type,
|
||||||
|
Date = activity.Date,
|
||||||
|
StartTime = activity.StartTime,
|
||||||
|
EndTime = activity.EndTime,
|
||||||
|
EffortFelt = activity.Effort,
|
||||||
|
Variability = activity.Variability,
|
||||||
|
Variance = activity.Variance,
|
||||||
|
StandardDeviation = activity.StandardDeviation,
|
||||||
|
Average = activity.Average,
|
||||||
|
Maximum = activity.Maximum,
|
||||||
|
Minimum = activity.Minimum,
|
||||||
|
AverageTemperature = activity.AverageTemperature,
|
||||||
|
HasAutoPause = activity.HasAutoPause
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Activity? ToModel(this ActivityDto activityDto)
|
||||||
|
{
|
||||||
|
return activityDto.ToT(_mapper, activity => new Activity
|
||||||
|
{
|
||||||
|
Id = activityDto.Id,
|
||||||
|
Type = activityDto.Type,
|
||||||
|
Date = activityDto.Date,
|
||||||
|
StartTime = activityDto.StartTime,
|
||||||
|
EndTime = activityDto.EndTime,
|
||||||
|
Effort = activityDto.EffortFelt,
|
||||||
|
Variability = activityDto.Variability,
|
||||||
|
Variance = activityDto.Variance,
|
||||||
|
StandardDeviation = activityDto.StandardDeviation,
|
||||||
|
Average = activityDto.Average,
|
||||||
|
Maximum = activityDto.Maximum,
|
||||||
|
Minimum = activityDto.Minimum,
|
||||||
|
AverageTemperature = activityDto.AverageTemperature,
|
||||||
|
HasAutoPause = activityDto.HasAutoPause
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,6 +0,0 @@
|
|||||||
@HeartTrackAPI_HostAddress = http://localhost:5030
|
|
||||||
|
|
||||||
GET {{HeartTrackAPI_HostAddress}}/weatherforecast/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue