protected BaseRepository(IFreeSql fsql, Expression <Func <TEntity, bool> > filter, Func <string, string> asTable = null) { _ormScoped = DbContextScopedFreeSql.Create(fsql, () => _db, () => UnitOfWork); DataFilterUtil.SetRepositoryDataFilter(this, null); DataFilter.Apply("", filter); AsTable(asTable); }
protected BaseRepository(IFreeSql fsql, Expression <Func <TEntity, bool> > filter, Func <string, string> asTable = null) { Orm = fsql; DataFilterUtil.SetRepositoryDataFilter(this, null); DataFilter.Apply("", filter); AsTable(asTable); }
protected BaseRepository(IFreeSql fsql, Expression <Func <TEntity, bool> > filter, Func <string, string> asTable = null) { _ormScoped = DbContextScopedFreeSql.Create(fsql, () => _db, () => UnitOfWork); DataFilterUtil.SetRepositoryDataFilter(this, null); DataFilter.Apply("", filter); AsTable(asTable); fsql.GlobalFilter.GetFilters().ForEach(gf => { (DataFilter as DataFilter <TEntity>)._filtersByOrm.TryAdd(gf.Name, new DataFilter <TEntity> .FilterItemByOrm { Filter = gf, IsEnabled = true }); }); }
protected void ApplyDataFilter(string name, Expression <Func <TEntity, bool> > exp) => DataFilter.Apply(name, exp);