Example #1
0
        public async Task <GlobalItem[]> GetGlobalParentItems(Guid parentId)
        {
            const string query = "select * from GlobalItem where ParentId = @parentId";
            var          items = await _commonDb.QueryAsync <GlobalItem>(query, new { parentId });

            return(items.ToArray());
        }
Example #2
0
        public async Task <Item[]> GetItems(Guid parentId, Pager pager)
        {
            var offsetRowNumber = pager.Number * pager.Size - pager.Size;
            var items           = await _commonDb.QueryAsync <Item>("select * from Items where ParentId = @parentId " +
                                                                    "order by ItemId offset @offsetRowNumber fetch next @size rows only", new { offsetRowNumber, pager.Size });

            return(items.ToArray());
        }