Generator Changes at 9/27/2025 8:46:36 AM

This commit is contained in:
generator
2025-09-27 08:46:36 +03:30
parent fd82e3edcf
commit fd8614f72e
261 changed files with 6333 additions and 0 deletions
@@ -0,0 +1,23 @@
using System.Linq.Dynamic.Core;
using CMSMicroservice.Domain.Common;
namespace CMSMicroservice.Application.Common.Extensions;
public static class SortByExtensions
{
public static IQueryable<TSource> ApplyOrder<TSource>(this IQueryable<TSource> source,
string? sortBy) where TSource : BaseAuditableEntity
{
// default sort approach
if (sortBy is null or "")
{
source = source.OrderByDescending(p => p.Created);
return source;
}
// sort using dynamic linq
source = source.OrderBy(sortBy);
return source;
}
}