14 lines
429 B
C#
14 lines
429 B
C#
using System.Linq.Expressions;
|
|
|
|
namespace Tiger.Storage;
|
|
|
|
public interface IRepository<T>
|
|
{
|
|
Task<T?> FindAsync(object id);
|
|
Task SaveAsync(T entity);
|
|
Task SaveManyAsync(params T[] entities);
|
|
Task SaveManyAsync(IEnumerable<T> entities);
|
|
// Task FlushAsync();
|
|
Task<IEnumerable<T>> FindByAsync(Expression<Func<T, bool>>? expression = null);
|
|
Task<T?> FindOneByAsync(Expression<Func<T, bool>> expression);
|
|
} |