21 lines
811 B
C#
21 lines
811 B
C#
using Common.Models.DBDomain;
|
|
|
|
namespace DBConnection.Repositories.Interfaces;
|
|
|
|
public interface IRepository
|
|
{
|
|
|
|
}
|
|
|
|
public interface IRepository<TEntityType> : IRepository where TEntityType : BaseEntity
|
|
{
|
|
TEntityType Delete(TEntityType entity);
|
|
Task<TEntityType> Upsert(TEntityType entity, bool saveAfter=true);
|
|
Task<TEntityType?> GetIncluded(TEntityType entity);
|
|
Task<TEntityType?> GetIncluded(Func<TEntityType, bool> predicate);
|
|
Task<IEnumerable<TEntityType>> GetWhereIncluded(Func<TEntityType, bool> predicate);
|
|
Task<IEnumerable<TEntityType>> GetAllIncluded();
|
|
Task<IEnumerable<TEntityType>> UpsertMany(IEnumerable<TEntityType> entities, bool saveAfter=true);
|
|
Task PersistChanges();
|
|
Task<IEnumerable<TEntityType?>> GetWhereIncluded(IEnumerable<TEntityType> entities);
|
|
} |