public T Get(Func <T, bool> where, params Expression <Func <T, object> >[] navigationProperties)
        {
            T item;

            using (var context = new AutotraderScraperContext())
            {
                IQueryable <T> dbQuery = context.Set <T>();

                // Eager loading.
                foreach (Expression <Func <T, object> > navigationProperty in navigationProperties)
                {
                    dbQuery = dbQuery.Include(navigationProperty);
                }

                item = dbQuery
                       .AsNoTracking()         // Don't track any changes for the selected item.
                       .FirstOrDefault(where); // Apply where clause.
            }
            return(item);
        }
        public IList <T> GetAll(params Expression <Func <T, object> >[] navigationProperties)
        {
            IList <T> list;

            using (var context = new AutotraderScraperContext())
            {
                IQueryable <T> dbQuery = context.Set <T>();

                // Eager loading.
                foreach (Expression <Func <T, object> > navigationProperty in navigationProperties)
                {
                    dbQuery = dbQuery.Include(navigationProperty);
                }

                list = dbQuery
                       .AsNoTracking()
                       .ToList();
            }
            return(list);
        }