コード例 #1
0
ファイル: ReviewData.cs プロジェクト: ericjohnolson/wave
 public IEnumerable<ReviewDetails> Search(ReviewSearch search)
 {
     return dbContext.reviews.Where(x => x.venue.Contains(search.Venue) || (x.date_reviewed >= search.Start && x.date_reviewed <= search.End) ||
            x.review_title.title1.Contains(search.Title) ||
            x.review_contact.firstname.Contains(search.ReviewerFirstName) || x.review_contact.lastname.Contains(search.ReviewerLastName))
            .Select(m => new ReviewDetails
            {
                Reviewer = m.reviewedby > 0 ? m.review_contact.lastname + ", " + m.review_contact.firstname : "",
                ReviewedDate = m.date_reviewed,
                Title = m.review_title.title1,
                Venue = m.venue,
                ReviewerId = m.reviewedby,
                TitleId = m.title_id,
                Id = m.id
            });
 }
コード例 #2
0
 public ActionResult Search(ReviewSearch search)
 {
     var results = data.Search(search);
     search.Results = results;
     return View(search);
 }