diff --git a/src/Infrastructure/Data/SpecificationEvaluator.cs b/src/Infrastructure/Data/SpecificationEvaluator.cs index 0372e48..111b44f 100644 --- a/src/Infrastructure/Data/SpecificationEvaluator.cs +++ b/src/Infrastructure/Data/SpecificationEvaluator.cs @@ -28,9 +28,13 @@ namespace Microsoft.eShopWeb.Infrastructure.Data // Apply ordering if expressions are set if (specification.OrderBy != null) + { query = query.OrderBy(specification.OrderBy); + } else if (specification.OrderByDescending != null) + { query = query.OrderByDescending(specification.OrderByDescending); + } // Apply paging if enabled if (specification.isPagingEnabled)