2023-09-23 12:20:45 +00:00
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
|
|
|
namespace Tiger.Storage;
|
|
|
|
|
|
|
|
public interface IRepository<T>
|
|
|
|
{
|
|
|
|
Task<T?> FindAsync(object id);
|
|
|
|
Task SaveAsync(T entity);
|
2023-10-06 16:12:35 +00:00
|
|
|
Task SaveManyAsync(params T[] entities);
|
|
|
|
Task SaveManyAsync(IEnumerable<T> entities);
|
|
|
|
// Task FlushAsync();
|
2023-09-23 12:20:45 +00:00
|
|
|
Task<IEnumerable<T>> FindByAsync(Expression<Func<T, bool>>? expression = null);
|
|
|
|
Task<T?> FindOneByAsync(Expression<Func<T, bool>> expression);
|
|
|
|
}
|