Exemplo n.º 1
0
        public IEnumerable <TEntity> Get(Expression <Func <TEntity, bool> > filter = null, string includes = "")
        {
            IQueryable <TEntity> query = _context.Set <TEntity>();

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

            foreach (var includeProperty in includes.Split
                         (new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                query = query.Include(includeProperty);
            }

            return(query.ToList());
        }
Exemplo n.º 2
0
 public Repository(TLCNDatabaseContext context)
 {
     _context = context;
     _db      = _context.Set <TEntity>();
 }