using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Requests;
///
/// Параметры запроса на удаление куска телеметрии
///
public class TelemetryPartDeleteRequest : IValidatableObject
{
///
/// ключ телеметрии
///
public int IdTelemetry { get; set; }
///
/// greater or equal then Date. Must be set one of GeDate or LeDate
///
public DateTimeOffset? GeDate { get; set; }
///
/// less or equal then Date. Must be set one of GeDate or LeDate
///
public DateTimeOffset? LeDate { get; set; }
///
/// Валидация входящих данных
///
///
///
public IEnumerable Validate(ValidationContext validationContext)
{
if (IdTelemetry == 0)
yield return new ValidationResult($"IdTelemetry must be defined");
if (!GeDate.HasValue && !LeDate.HasValue)
yield return new ValidationResult($"GeDate or LeDate must be defined");
}
}