Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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> {
- using (var db = new KaguyaDb()) {
- var baseQuery = (from t in db.GetTable<T>().Where(predicate)
- select t);
- if(selector != null) {
- ..
- baseQuery = baseQuery.OrderBy..
- }
- return await baseQuery.ToListAsync();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement