示例#1
0
 public async virtual Task <List <Bookmark> > GetPublicBookmarksAsync()
 {
     return(await Bookmarks.FromSqlRaw("SELECT * FROM Bookmarks WHERE IsPublic = 1")
            .Include(b => b.Resource)
            .Include(b => b.User)
            .Include(b => b.Tags)
            .ToListAsync());
 }
示例#2
0
 public async virtual Task <List <Bookmark> > GetPublicBookmarksByUserIdAsync(int id)
 {
     return(await Bookmarks.FromSqlRaw("SELECT * FROM Bookmarks WHERE UserId = {0} AND IsPublic = 1", id)
            .Include(b => b.Resource)
            .Include(b => b.User)
            .Include(b => b.Tags)
            .ToListAsync());
 }
示例#3
0
 public async virtual Task <List <Bookmark> > GetBookmarksByFollowersAsync(int id)
 {
     return(await Bookmarks.FromSqlRaw("SELECT * FROM Bookmarks WHERE UserId IN (SELECT SubscriptionsId FROM UserUser WHERE FollowersId = {0}) AND IsPublic = 1 ORDER BY CreateDate DESC", id)
            .Include(b => b.Resource)
            .Include(b => b.User)
            .Include(b => b.Tags)
            .ToListAsync());
 }