Example #1
0
        public ReviewCollection FetchByQuery(Query qry)
        {
            ReviewCollection coll = new ReviewCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
        /// <summary>
        /// Fetch by product id.
        /// </summary>
        /// <param name="productId">The product id.</param>
        /// <returns></returns>
        public ReviewCollection FetchByProductId(int productId)
        {
            ReviewCollection reviewCollection = new ReviewCollection().
                                                Where(Review.Columns.ProductId, Comparison.Equals, productId).
                                                Load();

            return(reviewCollection);
        }
Example #3
0
        public ReviewCollection FetchAll()
        {
            ReviewCollection coll = new ReviewCollection();
            Query            qry  = new Query(Review.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
        /// <summary>
        /// Fetches by product id and user id.
        /// </summary>
        /// <param name="productId">The product id.</param>
        /// <param name="userId">The user id.</param>
        /// <returns></returns>
        public Review FetchByProductIdAndUserId(int productId, string userId)
        {
            Review           review           = null;
            ReviewCollection reviewCollection = new ReviewCollection().
                                                Where(Review.Columns.ProductId, productId).
                                                Where(Review.Columns.CreatedBy, userId).
                                                Load();

            if (reviewCollection.Count > 0)
            {
                review = reviewCollection[0];
            }
            return(review);
        }
Example #5
0
        public ReviewCollection FetchByID(object ReviewId)
        {
            ReviewCollection coll = new ReviewCollection().Where("ReviewId", ReviewId).Load();

            return(coll);
        }