33 lines
960 B
C#
33 lines
960 B
C#
using System.Linq.Expressions;
|
|
using adas_core.Domain.Models.Filter;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace adas_core.Domain;
|
|
|
|
public interface IDefaultRepository<T, in TS> where T : class
|
|
{
|
|
DbSet<T> GetSet();
|
|
IQueryable<T> Query();
|
|
IQueryable<T> Query(PaginationFilter? filter);
|
|
IQueryable<T> Query(int? currentPage, int? pageSize = null);
|
|
|
|
T? GetById(TS id, params Expression<Func<T, object>>[] includeExpressions);
|
|
|
|
T? GetById(TS id, QueryCustomizer<T> queryCustomizer);
|
|
|
|
/*[Obsolete("Use GetById(<S> id) instead")]
|
|
T? GetById(int id);
|
|
[Obsolete("Use GetById(<S> id) instead")]
|
|
T? GetById(long id);
|
|
//T? GetById(string id);*/
|
|
T? GetByIds(params object[] keyValues);
|
|
T Create(T obj);
|
|
List<T> Create(List<T> objs);
|
|
T Delete(T obj);
|
|
List<T> Delete(ICollection<T> objs);
|
|
void DeleteAll();
|
|
T Update(T obj);
|
|
int Count();
|
|
int Count(string status);
|
|
List<T> FindAll();
|
|
} |