- Chat messages are now loaded based on scroll position - Read status is now updated and set by last message read - Reworked script importing by using ScriptProvider
38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
using LANCommander.Server.Data.Enums;
|
|
using LANCommander.Server.Data.Models;
|
|
using LANCommander.Server.Services.Models;
|
|
using System.Linq.Expressions;
|
|
|
|
namespace LANCommander.Server.Services.Abstractions
|
|
{
|
|
public interface IBaseDatabaseService<T> where T : class, IBaseModel
|
|
{
|
|
IBaseDatabaseService<T> Query(Func<IQueryable<T>, IQueryable<T>> modifier);
|
|
IBaseDatabaseService<T> Include(params Expression<Func<T, object>>[] expressions);
|
|
IBaseDatabaseService<T> SortBy(Expression<Func<T, object>> expression, SortDirection direction = SortDirection.Ascending);
|
|
IBaseDatabaseService<T> AsNoTracking();
|
|
IBaseDatabaseService<T> AsSplitQuery();
|
|
Task<bool> AnyAsync();
|
|
|
|
Task<ICollection<T>> GetAsync();
|
|
|
|
Task<T> GetAsync(Guid id);
|
|
|
|
Task<ICollection<T>> GetAsync(Expression<Func<T, bool>> predicate);
|
|
|
|
Task<T> FirstOrDefaultAsync(Expression<Func<T, bool>> predicate);
|
|
|
|
Task<bool> ExistsAsync(Guid id);
|
|
Task<bool> ExistsAsync(Expression<Func<T, bool>> predicate);
|
|
|
|
Task<T> AddAsync(T entity);
|
|
|
|
Task<ExistingEntityResult<T>> AddMissingAsync(Expression<Func<T, bool>> predicate, T entity);
|
|
|
|
Task<T> UpdateAsync(T entity);
|
|
|
|
Task DeleteAsync(T entity);
|
|
// TODO: Add IBaseDatabaseService<>.DeleteRangeAsync
|
|
//Task DeleteRangeAsync(IEnumerable<T> entities);
|
|
}
|
|
}
|