Skip to content

Commit

Permalink
fix nullability issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed May 16, 2024
1 parent 9aa288b commit d7abba4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/MediatR.CommandQuery/Queries/EntityQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public EntityQuery(string? query, int page, int pageSize, string? sort)
PageSize = pageSize;
}

public EntityQuery(EntityFilter filter, int page = 1, int pageSize = 20)
public EntityQuery(EntityFilter? filter, int page = 1, int pageSize = 20)
: this(filter, Enumerable.Empty<EntitySort>(), page, pageSize)
{
}

public EntityQuery(EntityFilter filter, EntitySort sort, int page = 1, int pageSize = 20)
: this(filter, new[] { sort }, page, pageSize)
public EntityQuery(EntityFilter? filter, EntitySort? sort, int page = 1, int pageSize = 20)
: this(filter, (sort != null) ? [sort] : null, page, pageSize)
{
}

public EntityQuery(EntityFilter filter, IEnumerable<EntitySort> sort, int page = 1, int pageSize = 20)
public EntityQuery(EntityFilter? filter, IEnumerable<EntitySort>? sort, int page = 1, int pageSize = 20)
: base(filter, sort)
{
Page = page;
Expand Down
8 changes: 4 additions & 4 deletions src/MediatR.CommandQuery/Queries/EntitySelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ public EntitySelect(string? query, string? sort)
Sort = new List<EntitySort> { entitySort };
}

public EntitySelect(EntityFilter filter)
public EntitySelect(EntityFilter? filter)
{
Filter = filter;
}

public EntitySelect(EntityFilter filter, EntitySort sort)
public EntitySelect(EntityFilter? filter, EntitySort? sort)
{
Filter = filter;

if (sort != null)
Sort = new List<EntitySort> { sort };
Sort = [sort];
}

public EntitySelect(EntityFilter filter, IEnumerable<EntitySort> sort)
public EntitySelect(EntityFilter? filter, IEnumerable<EntitySort>? sort)
{
Filter = filter;
Sort = sort?.ToList();
Expand Down

0 comments on commit d7abba4

Please sign in to comment.