mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-11-04 17:20:49 +08:00
- 增加 FreeSql.Repository DataFilter 属性;
```csharp
repos.DataFilter.Disable("test") 临时禁用,不影响全部;
repos.DataFilter.DisableAll()
repos.DataFilter.Enable("test")
repos.DataFilter.EnableAll()
repos.DataFilter.Apply("name", a => a.Id > 1) 附加新的过滤器
```
23 lines
463 B
C#
23 lines
463 B
C#
using System.Threading.Tasks;
|
|
|
|
namespace FreeSql {
|
|
public interface IReadOnlyRepository<TEntity> : IRepository
|
|
where TEntity : class {
|
|
|
|
IDataFilter<TEntity> DataFilter { get; }
|
|
|
|
ISelect<TEntity> Select { get; }
|
|
}
|
|
|
|
public interface IReadOnlyRepository<TEntity, TKey> : IReadOnlyRepository<TEntity>
|
|
where TEntity : class {
|
|
TEntity Get(TKey id);
|
|
|
|
Task<TEntity> GetAsync(TKey id);
|
|
|
|
TEntity Find(TKey id);
|
|
|
|
Task<TEntity> FindAsync(TKey id);
|
|
}
|
|
}
|