public IEnumerable <T> AllIncluding(params Expression <Func <T, object> >[] includeProperties)
 {
     return(includeProperties
            .Aggregate(_context.Set <T>().AsQueryable(), (current, includeProperty) => current.Include(includeProperty)));
 }
예제 #2
0
 public virtual IEnumerable <T> GetAll()
 {
     return(_context.Set <T>().AsEnumerable());
 }
예제 #3
0
 public void Add(T entity)
 {
     _context.Set <T>().Add(entity);
 }
예제 #4
0
 public Repository(BlogContext context)
 {
     entities = context.Set <TEntity>();
 }