session-companion/SessionCompanion/SessionCompanion.Database/Repositories/Base/IRepository.cs

25 lines
697 B
C#

using SessionCompanion.Database.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database.Repositories.Base
{
public interface IRepository<T> where T : BaseEntity
{
IQueryable<T> Get();
IQueryable<T> Get(Expression<Func<T, bool>> expression);
Task<T> Get(int id);
Task Create(T entity);
Task Update(T entity);
void Delete(T entity);
Task<bool> Any(Expression<Func<T, bool>> expression);
Task<bool> Any(int id);
void Dispose();
Task Save();
}
}