-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #460 from neozhu/removeAutoFilterer
🍒 remove AutoFilterer and use Ardalis.Specification
- Loading branch information
Showing
56 changed files
with
265 additions
and
2,131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
388 changes: 0 additions & 388 deletions
388
src/Application/Common/Extensions/ExpressionExtensions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Ardalis.Specification.EntityFrameworkCore; | ||
using Ardalis.Specification; | ||
using CleanArchitecture.Blazor.Domain.Common; | ||
using DocumentFormat.OpenXml.Bibliography; | ||
|
||
namespace CleanArchitecture.Blazor.Application.Common.Extensions; | ||
|
||
public static class QueryableExtensions | ||
{ | ||
public static IQueryable<T> Specify<T>(this IQueryable<T> query, ISpecification<T> spec) where T : class, IEntity | ||
public static IQueryable<T> Specify<T>(this IQueryable<T> query, ISpecification<T> spec, bool evaluateCriteriaOnly=false) where T : class, IEntity | ||
{ | ||
var queryableResultWithIncludes = spec.Includes | ||
.Aggregate(query, | ||
(current, include) => include(current)); | ||
var secondaryResult = spec.IncludeStrings | ||
.Aggregate(queryableResultWithIncludes, | ||
(current, include) => current.Include(include)); | ||
return secondaryResult.Where(spec.Criteria); | ||
return new SpecificationEvaluator().GetQuery(query, spec, evaluateCriteriaOnly); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 0 additions & 45 deletions
45
src/Application/Features/Customers/Caching/CustomerCacheKey.cs
This file was deleted.
Oops, something went wrong.
64 changes: 0 additions & 64 deletions
64
src/Application/Features/Customers/Commands/AddEdit/AddEditCustomerCommand.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.