Пример #1
0
        protected override IEnumerable<SearchSuggestion> GetSuggestions(string term)
        {
            var dinners = new DapperDinnerRepository().FindDinnersByText(term).ToArray();

            return from dinner in dinners
                   select new
                       SearchSuggestion
                   {
                       Description = dinner.Description,
                       Term = dinner.Title + " with " + dinner.HostedBy,
                   };
        }
Пример #2
0
        protected override IEnumerable<SearchResult> GetResults(string q)
        {
            var dinners = new DapperDinnerRepository().FindDinnersByText(q).ToArray();

            return from dinner in dinners
                   select new
                       SearchResult
                       {
                           Description = dinner.Description,
                           Title = dinner.Title + " with " + dinner.HostedBy,
                           Path = "/" + dinner.DinnerID
                       };
        }