public async Task <IEnumerable <Bookmark> > FindBookmarksByTypeAsync(string bookmarkType, string?tenantId = default, int skip = 0, int take = int.MaxValue, CancellationToken cancellationToken = default) { var specification = new BookmarkTypeSpecification(bookmarkType, tenantId); var paging = Paging.Create(skip, take); var orderBy = new OrderBy <Bookmark>(x => x.Id, SortDirection.Ascending); return(await _bookmarkStore.FindManyAsync(specification, orderBy, paging, cancellationToken)); }
public async Task <IEnumerable <UserAction> > GetAllUserActionsAsync(int?skip = default, int?take = default, string?tenantId = default, CancellationToken cancellationToken = default) { var specification = BookmarkTypeSpecification.For <UserTaskBookmark>(tenantId); var paging = Paging.Create(skip, take); var bookmarks = await _bookmarkStore.FindManyAsync(specification, paging : paging, cancellationToken : cancellationToken); return(bookmarks.Select(bookmark => { var model = _bookmarkSerializer.Deserialize <UserTaskBookmark>(bookmark.Model); return new UserAction(bookmark.WorkflowInstanceId, model.Action); })); }