23 lines
820 B
C#
23 lines
820 B
C#
|
using Ardalis.Specification;
|
|||
|
using DD.Persistence.Database.EntityAbstractions;
|
|||
|
|
|||
|
namespace DD.Persistence.Database.Specifications.ValuesItem;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Спецификация "больше либо равно" для значений IValuesItem в соответствии с индексацией
|
|||
|
/// </summary>
|
|||
|
/// <typeparam name="TEntity"></typeparam>
|
|||
|
public class ValueGreateOrEqualSpecification<TEntity> : Specification<TEntity>
|
|||
|
where TEntity : IValuesItem
|
|||
|
{
|
|||
|
public ValueGreateOrEqualSpecification(int index, double? value)
|
|||
|
{
|
|||
|
Query.Where(e => Convert.ToDouble(e.Values[index]) >= value);
|
|||
|
}
|
|||
|
|
|||
|
public ValueGreateOrEqualSpecification(int index, DateTimeOffset? value)
|
|||
|
{
|
|||
|
Query.Where(e => DateTimeOffset.Parse(Convert.ToString(e.Values[index])!) >= value);
|
|||
|
}
|
|||
|
}
|