mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-05-01 23:02:50 +08:00
32 lines
758 B
C#
32 lines
758 B
C#
using System;
|
|
using System.Linq.Expressions;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FreeSql
|
|
{
|
|
public interface IReadOnlyRepository<TEntity> : IBaseRepository
|
|
where TEntity : class
|
|
{
|
|
|
|
IDataFilter<TEntity> DataFilter { get; }
|
|
|
|
ISelect<TEntity> Select { get; }
|
|
|
|
ISelect<TEntity> Where(Expression<Func<TEntity, bool>> exp);
|
|
ISelect<TEntity> WhereIf(bool condition, Expression<Func<TEntity, bool>> exp);
|
|
}
|
|
|
|
public interface IReadOnlyRepository<TEntity, TKey> : IReadOnlyRepository<TEntity>
|
|
where TEntity : class
|
|
{
|
|
TEntity Get(TKey id);
|
|
TEntity Find(TKey id);
|
|
|
|
#if net40
|
|
#else
|
|
Task<TEntity> GetAsync(TKey id);
|
|
Task<TEntity> FindAsync(TKey id);
|
|
#endif
|
|
}
|
|
}
|