Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed May 11, 2024
1 parent a8a9f79 commit 5dc93c6
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 27 deletions.
25 changes: 0 additions & 25 deletions src/Shiny.Extensions.EntityFramework/Contracts/Pagination.cs

This file was deleted.

27 changes: 25 additions & 2 deletions src/Shiny.Extensions.EntityFramework/QueryableExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Linq;
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore;
using Shiny.Contracts;

namespace Shiny;

Expand Down Expand Up @@ -76,4 +75,28 @@ public static async Task<List<T>> ToListAsync<T>(this IAsyncEnumerable<T> source
}
return list;
}
}
}

public record PagedDataRequest(
int Page,
int Size,
OrderBy[]? Ordering = null,
bool IncludeTotalCount = true
);

public record OrderBy(
string Property,
bool Asc = true
);


public record PagedDataList<T>(
IList<T> Results,
int CurrentPage,
int TotalCount,
int TotalPages
)
{
public bool HasPrevious => this.CurrentPage > 1;
public bool HasNext => this.TotalPages > this.CurrentPage;
};
4 changes: 4 additions & 0 deletions src/Shiny.Extensions.WebHosting/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
global using System;
global using System.Threading;
global using System.Threading.Tasks;
global using System.Collections.Generic;

0 comments on commit 5dc93c6

Please sign in to comment.