public async Task <int> GetLikeCount(SpudderDB db) { return(await db.Likes.CountAsync(like => like.Spud_Id == this.Id)); }
public IQueryable <Like> GetLikes(SpudderDB db) { return(db.Likes.Where(like => like.Spud_Id == this.Id)); }
/// <summary> /// Returns all children for this Spud /// </summary> public IQueryable <Spud> GetChildren(SpudderDB db) { return(db.Spuds.AsQueryable().Where(spud => spud.Parent == this.Id)); }
/// <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)); }
/// <summary> /// Returns the Spud this like belongs to /// </summary> public async Task <Spud> GetSpud(SpudderDB db) { return(await db.Spuds.FindAsync(Spud_Id)); }