-
Notifications
You must be signed in to change notification settings - Fork 1
/
IBaseRepo.cs
24 lines (23 loc) · 932 Bytes
/
IBaseRepo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace CommonGenericClasses
{
#nullable disable
public interface IBaseRepo<TEntity> where TEntity : BaseEntity
{
Task<TEntity> AddAsync(TEntity entity);
void Dispose();
Task<TEntity> Edit(TEntity entity);
Task<IEnumerable<TEntity>> Get(Expression<Func<TEntity, bool>> predicate = null, Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null, string include = "");
Task<List<TEntity>> GetAllAsync();
Task<TEntity> GetByIdAsync(object id);
TEntity Remove(TEntity entity);
Task<TEntity> RemoveAsync(Expression<Func<TEntity, bool>> predicate);
Task<TEntity> RemoveByIdAsync(object id);
Task<IEnumerable<TEntity>> RemoveRangeAsync(Expression<Func<TEntity, bool>> predicate);
Task Save();
}
}