Skip to content

Commit

Permalink
remove check that doubles
Browse files Browse the repository at this point in the history
  • Loading branch information
OlhaHoliak committed Aug 5, 2021
1 parent b992614 commit 1d06fb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private QueryContainer CreateQueryFromFilter(WorkshopFilterES filter)
return queryContainer;
}

if (!(string.IsNullOrEmpty(filter.SearchText) || string.IsNullOrWhiteSpace(filter.SearchText)))
if (!string.IsNullOrWhiteSpace(filter.SearchText))
{
queryContainer &= new MultiMatchQuery()
{
Expand Down Expand Up @@ -151,7 +151,7 @@ private QueryContainer CreateQueryFromFilter(WorkshopFilterES filter)
};
}

if (!(string.IsNullOrEmpty(filter.City) || string.IsNullOrWhiteSpace(filter.City)))
if (!string.IsNullOrWhiteSpace(filter.City))
{
queryContainer &= new MatchQuery()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public async Task<IActionResult> GetByProviderId(long id)
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetByFilter([FromQuery] WorkshopFilter filter)
{
if (string.IsNullOrEmpty(filter.City) || string.IsNullOrWhiteSpace(filter.City))
if (string.IsNullOrWhiteSpace(filter.City))
{
filter.City = "Êè¿â";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private Expression<Func<Workshop, bool>> PredicateBuild(WorkshopFilter filter)
return predicate;
}

if (!(string.IsNullOrEmpty(filter.SearchText) || string.IsNullOrWhiteSpace(filter.SearchText)))
if (!string.IsNullOrWhiteSpace(filter.SearchText))
{
var tempPredicate = PredicateBuilder.False<Workshop>();
foreach (var word in filter.SearchText.Split(' ', ',', StringSplitOptions.RemoveEmptyEntries))
Expand Down Expand Up @@ -325,7 +325,7 @@ private Expression<Func<Workshop, bool>> PredicateBuild(WorkshopFilter filter)
predicate = predicate.And(x => x.WithDisabilityOptions);
}

if (!(string.IsNullOrEmpty(filter.City) || string.IsNullOrWhiteSpace(filter.City)))
if (!string.IsNullOrWhiteSpace(filter.City))
{
predicate = predicate.And(x => x.Address.City == filter.City);
}
Expand Down

0 comments on commit 1d06fb5

Please sign in to comment.