示例#1
0
        public async Task <bool> RemoveBeer(ObjectId id)
        {
            bool bResp = await Collection.RemoveAsync(id);

            if (bResp)
            {
                List <Review> reviews = await ReviewCollection.GetListAsync(r => r.BeerId == id.ToString());

                foreach (Review review in reviews)
                {
                    _ = ReviewCollection.RemoveAsync(review.Id);
                }
            }
            return(bResp);
        }
示例#2
0
 public async Task <List <Review> > GetReviews(string beerId)
 {
     return(await Collection.GetListAsync(r => r.BeerId == beerId));
 }