Exemplo n.º 1
0
 public async Task <int> GetLikeCount(SpudderDB db)
 {
     return(await db.Likes.CountAsync(like => like.Spud_Id == this.Id));
 }
Exemplo n.º 2
0
 public IQueryable <Like> GetLikes(SpudderDB db)
 {
     return(db.Likes.Where(like => like.Spud_Id == this.Id));
 }
Exemplo n.º 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));
        }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }