Bump to Ardalis Specification 9.0.1
In version 9.0.1, Ardalis Specification do not have class OrderedSpecificationBuilder<T> so some methord in SpecificationBuilderExtensions.cs error:
- public static IOrderedSpecificationBuilder<T> AdvancedSearch<T>
- private static void AddSearchPropertyByKeyword<T>
- public static IOrderedSpecificationBuilder<T> OrderBy<T>
using Ardalis.Specification;
namespace xxxx.Framework.Core.Specifications;
public class OrderedSpecificationBuilder<T> : IOrderedSpecificationBuilder<T> { public Specification<T> Specification { get; }
public bool IsChainDiscarded { get; set; }
public OrderedSpecificationBuilder(Specification<T> specification)
: this(specification, isChainDiscarded: false)
{
}
public OrderedSpecificationBuilder(Specification<T> specification, bool isChainDiscarded)
{
Specification = specification;
IsChainDiscarded = isChainDiscarded;
}
}
There is no need to return IOrderedSpecificaationBuilder. These methods should return the ISpecificationBuilder.
Returning the ordered builder actually might be dangerous, since the caller unintentionally can continue with ThenBy methods (without having OrderBy applied).