using System.ComponentModel.DataAnnotations; using Kurisu.AspNetCore.CustomClass; namespace Dlhis.Canteen.MealSupplementRecord.Request; public class MealSupplementRecordMyRequest : IValidatableObject { public DateTimePeriod SearchDateTimePeriod { get; set; } public IEnumerable Validate(ValidationContext validationContext) { if (SearchDateTimePeriod.End.HasValue) { SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1); } yield break; } }