using System.Linq.Expressions; namespace ZeroFramework.DeviceCenter.Domain.Specifications.Builder { public static class OrderedBuilderExtensions { public static IOrderedSpecificationBuilder ThenBy( this IOrderedSpecificationBuilder orderedBuilder, Expression> orderExpression) { ((List<(Expression> OrderExpression, OrderTypeEnum OrderType)>)orderedBuilder.Specification.OrderExpressions) .Add((orderExpression, OrderTypeEnum.ThenBy)); return orderedBuilder; } public static IOrderedSpecificationBuilder ThenByDescending( this IOrderedSpecificationBuilder orderedBuilder, Expression> orderExpression) { ((List<(Expression> OrderExpression, OrderTypeEnum OrderType)>)orderedBuilder.Specification.OrderExpressions) .Add((orderExpression, OrderTypeEnum.ThenByDescending)); return orderedBuilder; } } }