mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 移除 IBaseRepository DataFilter 仓储过滤器;
This commit is contained in:
@ -37,10 +37,6 @@ namespace FreeSql
|
||||
GetRepositoryDbField(entityType, "_asTablePriv").SetValue(repo,
|
||||
_repo.GetType().GetField("_asTablePriv", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_repo));
|
||||
//GetRepositoryDbField(_repo.EntityType, "_asTablePriv").GetValue(_repo));
|
||||
|
||||
if (typeof(IBaseRepository<>).MakeGenericType(_repo.EntityType).IsAssignableFrom(_repo.GetType()))
|
||||
typeof(RepositoryDbContext).GetMethod("SetRepositoryDataFilter").MakeGenericMethod(_repo.EntityType)
|
||||
.Invoke(null, new object[] { repo, _repo });
|
||||
}
|
||||
|
||||
var sd = Activator.CreateInstance(typeof(RepositoryDbSet<>).MakeGenericType(entityType), repo) as IDbSet;
|
||||
@ -49,16 +45,6 @@ namespace FreeSql
|
||||
return sd;
|
||||
}
|
||||
|
||||
public static void SetRepositoryDataFilter<TEntity>(object repo, IBaseRepository<TEntity> baseRepo) where TEntity : class
|
||||
{
|
||||
var filter = baseRepo.DataFilter as DataFilter<TEntity>;
|
||||
DataFilterUtil.SetRepositoryDataFilter(repo, fl =>
|
||||
{
|
||||
foreach (var f in filter._filters)
|
||||
fl.Apply<TEntity>(f.Key, f.Value.Expression);
|
||||
});
|
||||
}
|
||||
|
||||
int SaveChangesSuccess()
|
||||
{
|
||||
int ret;
|
||||
|
Reference in New Issue
Block a user