public IEnumerable <Company> All(CompanyIncludes includes)
        {
            var query = Context.Set <Company>().AsQueryable();

            query = AddIncludes(query, includes);
            return(query.AsEnumerable());
        }
        public Company Get(int id, CompanyIncludes includes)
        {
            var query = Context.Set <Company>().AsQueryable();

            query = AddIncludes(query, includes);
            query = query.Where(i => i.ID == id);
            return(query.FirstOrDefault());
        }
        private IQueryable <Company> AddIncludes(IQueryable <Company> query, CompanyIncludes includes)
        {
            if (includes == null)
            {
                return(query);
            }

            if (includes.AddressDetails)
            {
                query = query.Include(i => i.Address);
            }

            return(query);
        }
        public IEnumerable <Company> Find(Expression <Func <Company, bool> > predicate, CompanyIncludes includes)
        {
            var query = Context.Set <Company>().AsQueryable();

            query = AddIncludes(query, includes);
            return(query.Where(predicate).AsEnumerable());
        }