public virtual IQueryable <T> IncludeAll()
        {
            var query = _context.Set <T>().AsQueryable();

            foreach (var property in _context.Model.FindEntityType(typeof(T)).GetNavigations())
            {
                query = query.Include(property.Name);
            }
            return(query);
        }
 public UserManagementRepository(UserManagementContext context)
 {
     _context = context;
     _dbSet   = _context.Set <T>();
 }
Пример #3
0
 public void Add(TEntity entity)
 {
     Context.Set <TEntity>().Add(entity);
 }