/
Extrap
/
Network_technologies_Project
Обзор
Документация
Войти
/
Extrap
/
Network_technologies_Project
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Project/Models/DTOs/WorkoutDTOs.cs
50 строк
2 KB
Extrap
Конечка (хз, но для воскресенья да)
21 дек 2025, 22:48
21 дек 2025, 22:48
1c6535d
Код
Авторство
О чём код?
namespace Project.Models.DTOs { public class WorkoutCreateDTO { public DateTime StartTime { get; set; } public long DurationSeconds { get; set; } public Workout.ActivityType Type { get; set; } public decimal? DistanceKm { get; set; } public int? AvgHeartRate { get; set; } public int? MaxHeartRate { get; set; } public int? Calories { get; set; } public string? Notes { get; set; } } public class WorkoutUpdateDTO : WorkoutCreateDTO { public Guid Id { get; set; } } public class WorkoutResponseDTO { public Guid Id { get; set; } public DateTime StartTime { get; set; } public long DurationSeconds { get; set; } public string Type { get; set; } = ""; public decimal? DistanceKm { get; set; } public int? AvgHeartRate { get; set; } public int? MaxHeartRate { get; set; } public int? Calories { get; set; } public string? Notes { get; set; } public DateTime CreatedAt { get; set; } public static WorkoutResponseDTO FromWorkout(Workout workout) { return new WorkoutResponseDTO { Id = workout.Id, StartTime = workout.StartTime, DurationSeconds = workout.DurationSeconds, Type = workout.Type.ToString(), DistanceKm = workout.DistanceKm, AvgHeartRate = workout.AvgHeartRate, MaxHeartRate = workout.MaxHeartRate, Calories = workout.Calories, Notes = workout.Notes, CreatedAt = workout.CreatedAt }; } } }