Advertisement
Guest User

Untitled

a guest
Feb 14th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. public static async Task<List<T>> GetLimitAsync<T>(Expression<Func<T, bool>> predicate, uint limit, Expression<Func<T, bool>> selector = null, bool orderByDescending = false) where T : class, IKaguyaQueryable<T> {
  2. using (var db = new KaguyaDb()) {
  3. var baseQuery = (from t in db.GetTable<T>().Where(predicate)
  4. select t);
  5. if(selector != null) {
  6. ..
  7. baseQuery = baseQuery.OrderBy..
  8. }
  9. return await baseQuery.ToListAsync();
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement