public DinnerSet GetFilteredDinners(int start, int count, string sortType, string sortColumn, string filter)
        {
            var totalDinnerCount = _dinners.Count;
            var filteredDinnerCount = _dinners.Count;
            var dinnersToReturn = _dinners.Skip(start).Take(count);

            var result = new DinnerSet() { Dinners = dinnersToReturn.ToList(), FilteredDinnerCount = filteredDinnerCount, TotalDinnerCount = totalDinnerCount };
            return result;
        }
        /// <summary>
        /// Get Filtered Dinners
        /// </summary>
        /// <param name="start">
        /// The start.
        /// </param>
        /// <param name="count">
        /// The count.
        /// </param>
        /// <param name="filter">
        /// The filter.
        /// </param>
        /// <param name="sortType">
        /// The sort type.
        /// </param>
        /// <param name="sortColumn">
        /// The sort column.
        /// </param>
        /// <returns>
        /// A Dinenr Set
        /// </returns>
        public DinnerSet GetFilteredDinners(int start, int count, string filter, string sortType, string sortColumn)
        {
            using (NerdDinnersDb nerdDinnersDb = new NerdDinnersDb())
            {
                var totalDinnerCount = nerdDinnersDb.Dinners.Count();

                var filteredDinnerQuery = nerdDinnersDb.Dinners.AsQueryable();
                if (!string.IsNullOrEmpty(filter))
                {
                    filteredDinnerQuery =
                        from d in nerdDinnersDb.Dinners
                        where d.Title.Contains(filter)
                              || d.Address.Contains(filter)
                              || d.HostedBy.Contains(filter)
                        select d;
                }

                var filteredDinnerCount = filteredDinnerQuery.Count();
                var sortColumnLower = sortColumn.ToLower();

                var orderingFunction =
                  sortColumnLower == "dinnerid" ? new Func<Dinner, IComparable>(d => d.DinnerId)
                      : sortColumnLower == "title" ? new Func<Dinner, IComparable>(d => d.Title)
                            : sortColumnLower == "address" ? new Func<Dinner, IComparable>(d => d.Address)
                                  : sortColumnLower == "eventdate" ? new Func<Dinner, IComparable>(d => d.EventDate)
                                      : new Func<Dinner, IComparable>(d => d.Country);

                List<Dinner> sortedDinners;
                if (sortType == "asc")
                {
                    sortedDinners = (
                        from d in filteredDinnerQuery
                        select d).OrderBy(orderingFunction).ToList();
                }
                else if (sortType == "desc")
                {
                    sortedDinners =
                        (from d in filteredDinnerQuery
                        select d).OrderByDescending(orderingFunction).ToList();
                }
                else
                {
                    sortedDinners = filteredDinnerQuery.ToList();
                }

                var pageDinners = sortedDinners.Skip(start).Take(count);

                var result = new DinnerSet()
                                 {
                                     Dinners = pageDinners.ToList(),
                                     FilteredDinnerCount = filteredDinnerCount,
                                     TotalDinnerCount = totalDinnerCount
                                 };
                return result;
            }
        }