示例#1
0
        public override List <BookToBeReviewed> Get(BookToBeReviewed instance)
        {
            if (instance == null || string.IsNullOrEmpty(instance.File))
            {
                throw new ArgumentNullException();
            }

            FilterDefinition <BookToBeReviewed> filter = Builders <BookToBeReviewed> .Filter.Eq("File", instance.File);

            try
            {
                return(BooksToReviewList.Find <BookToBeReviewed>(filter).ToList <BookToBeReviewed>());
            }
            catch (InvalidOperationException e)
            {
                return(new List <BookToBeReviewed>());
            }
        }
示例#2
0
        public override List <BookToBeReviewed> Get()
        {
            FilterDefinition <BookToBeReviewed> filter = Builders <BookToBeReviewed> .Filter.Where(x => true);

            return(BooksToReviewList.Find <BookToBeReviewed>(filter).ToList <BookToBeReviewed>());
        }