Skip to content

Bump to Ardalis Specification 9.0.1 #1109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Mike6x opened this issue Apr 1, 2025 · 3 comments · May be fixed by #1111
Open

Bump to Ardalis Specification 9.0.1 #1109

Mike6x opened this issue Apr 1, 2025 · 3 comments · May be fixed by #1111

Comments

@Mike6x
Copy link

Mike6x commented Apr 1, 2025

In version 9.0.1, Ardalis Specification do not have class OrderedSpecificationBuilder so some methord in SpecificationBuilderExtensions.cs
error:

  • public static IOrderedSpecificationBuilder AdvancedSearch
  • private static void AddSearchPropertyByKeyword
  • public static IOrderedSpecificationBuilder OrderBy
@aabordalo
Copy link

using Ardalis.Specification;

namespace xxxx.Framework.Core.Specifications;

public class OrderedSpecificationBuilder : IOrderedSpecificationBuilder
{
public Specification 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;
}

}

@aabordalo
Copy link

Image

@fiseni fiseni linked a pull request Apr 2, 2025 that will close this issue
@fiseni
Copy link

fiseni commented Apr 2, 2025

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants