Skip to content

Commit

Permalink
🔨
Browse files Browse the repository at this point in the history
  • Loading branch information
NazarovMikhail committed Jan 10, 2024
1 parent 3a978fc commit 9f18e82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Monq.Core.Paging.Tests/PagingExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public async Task ShouldProperlySearchDataTablesRecordsInListByStringField()
Assert.Equal(3, result.Data.First().Id);
}

[Fact(DisplayName = "Проверка фильтрации элементов по полю paging.Search по полю типа Guid")]
[Fact(DisplayName = "Checking a filtration by property paging.Search (property type is Guid).")]
public void ShouldProperlySearchRecordsInListByGuidField()
{
var guidValue = new Guid(string.Format("{0:00000000-0000-0000-0000-000000000000}", 7));
Expand Down
3 changes: 3 additions & 0 deletions src/Monq.Core.Paging/Extensions/QueryableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public static IQueryable<TSource> OrderByProperty<TSource>(this IQueryable<TSour

var props = typeof(TSource).GetPublicProperties(searching.Depth, searching.InSearch).ToList();
var stringProperties = props.Where(p => p.Property.PropertyType == typeof(string)).ToList();

if (!props.Any())
return null;

var parameter = Expression.Parameter(typeof(TSource), "t");
var methodContains = typeof(string).GetMethod(nameof(string.Contains), new[] { typeof(string) });
Expand Down

0 comments on commit 9f18e82

Please sign in to comment.