/// <inheritdoc /> public async Task <ServiceResult <DateTimeOffset> > GetNextInfractionExpiration() { var result = await InfractionRepository.ReadExpiresFirstOrDefaultAsync( new InfractionSearchCriteria() { IsRescinded = false, IsDeleted = false, ExpiresRange = new DateTimeOffsetRange() { From = DateTimeOffset.MinValue, To = DateTimeOffset.MaxValue, } }, new[] { new SortingCriteria() { PropertyName = nameof(InfractionSummary.Expires), Direction = SortDirection.Ascending } }); if (result == null) { return(ServiceResult <DateTimeOffset> .FromError("No expiring infractions found.")); } return(ServiceResult.FromResult(result.Value)); }
/// <inheritdoc /> public Task <DateTimeOffset?> GetNextInfractionExpiration() => InfractionRepository.ReadExpiresFirstOrDefaultAsync( new InfractionSearchCriteria() { IsRescinded = false, IsDeleted = false, ExpiresRange = new DateTimeOffsetRange() { From = DateTimeOffset.MinValue, To = DateTimeOffset.MaxValue, } }, new [] { new SortingCriteria() { PropertyName = nameof(InfractionSummary.Expires), Direction = SortDirection.Ascending } });