示例#1
0
 public async Task <int> GetLikeCount(SpudderDB db)
 {
     return(await db.Likes.CountAsync(like => like.Spud_Id == this.Id));
 }
示例#2
0
 public IQueryable <Like> GetLikes(SpudderDB db)
 {
     return(db.Likes.Where(like => like.Spud_Id == this.Id));
 }
示例#3
0
        /// <summary>
        /// Returns all children for this Spud
        /// </summary>

        public IQueryable <Spud> GetChildren(SpudderDB db)
        {
            return(db.Spuds.AsQueryable().Where(spud => spud.Parent == this.Id));
        }
示例#4
0
 /// <summary>
 /// Returns the parent for this spud
 /// </summary>
 public async Task <Spud> GetParent(SpudderDB db)
 {
     return(await db.Spuds.AsQueryable().FirstOrDefaultAsync(spud => spud.Id == this.Parent));
 }
示例#5
0
 /// <summary>
 /// Returns the Spud this like belongs to
 /// </summary>
 public async Task <Spud> GetSpud(SpudderDB db)
 {
     return(await db.Spuds.FindAsync(Spud_Id));
 }