Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        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
                });
            });
        }
Ejemplo n.º 4
0
 protected void ApplyDataFilter(string name, Expression <Func <TEntity, bool> > exp) => DataFilter.Apply(name, exp);