Example #1
0
        /// <summary>
        /// Creates a Kirja page review
        /// </summary>
        /// <param name="pageReview">Page review to create</param>
        /// <returns>Created page, with filled id</returns>
        public async Task <KirjaPageReview> CreatePageReview(KirjaPageReview pageReview)
        {
            pageReview.Id = Guid.NewGuid().ToString();
            await _PageReviewCollection.InsertOneAsync(pageReview);

            return(pageReview);
        }
Example #2
0
 /// <summary>
 /// Deletes a page review
 /// </summary>
 /// <param name="pageReview">Page review to delete</param>
 /// <returns>Task</returns>
 public async Task DeletePageReview(KirjaPageReview pageReview)
 {
     DeleteResult result = await _PageReviewCollection.DeleteOneAsync(p => p.Id == pageReview.Id);
 }
Example #3
0
 /// <summary>
 /// Update a Kirja page review
 /// </summary>
 /// <param name="pageReview">Page review to update</param>
 /// <returns>Task</returns>
 public async Task UpdatePageReview(KirjaPageReview pageReview)
 {
     ReplaceOneResult result = await _PageReviewCollection.ReplaceOneAsync(p => p.Id == pageReview.Id, pageReview);
 }
Example #4
0
        /// <summary>
        /// Returns a page review by external access token
        /// </summary>
        /// <param name="externalAccessToken">External access token</param>
        /// <returns>Page review</returns>
        public async Task <KirjaPageReview> GetPageReviewByExternalAccessToken(string externalAccessToken)
        {
            KirjaPageReview review = await _PageReviewCollection.Find(p => p.ExternalAccessToken == externalAccessToken).FirstOrDefaultAsync();

            return(review);
        }
Example #5
0
        /// <summary>
        /// Returns a page review by id
        /// </summary>
        /// <param name="reviewId">Id of the page review</param>
        /// <returns>Page review</returns>
        public async Task <KirjaPageReview> GetPageReviewById(string reviewId)
        {
            KirjaPageReview review = await _PageReviewCollection.Find(p => p.Id == reviewId).FirstOrDefaultAsync();

            return(review);
        }