Exemplo n.º 1
0
        public virtual List <T> Get(Expression <Func <T, bool> > filter = null,
                                    Func <IQueryable <T>, IOrderedQueryable <T> > orderBy = null, params Expression <Func <T, object> >[] includes)
        {
            IQueryable <T> query = context.Set <T>();

            foreach (Expression <Func <T, object> > include in includes)
            {
                query = query.Include(include);
            }

            if (filter != null)
            {
                query = query.Where(filter);
            }

            if (orderBy != null)
            {
                query = orderBy(query);
            }

            return(query.ToList());
        }
Exemplo n.º 2
0
 public BaseRepository(PropertyContext context)
 {
     this.context = context;
     Entities     = context.Set <T>();
 }
Exemplo n.º 3
0
 public IEnumerable <Property> GetAllProperties()
 {
     return(_context.Set <Property>().ToList());
 }