TigerEmu/Storage/IRepository.cs

14 lines
429 B
C#
Raw Normal View History

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);
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);
}