24 lines
811 B
C#
24 lines
811 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq.Expressions;
|
|
using System.Text;
|
|
|
|
namespace KanSan.Base.Interfaces
|
|
{
|
|
public interface IRepository<TEntity> where TEntity : class
|
|
{
|
|
void Delete(TEntity entityToDelete);
|
|
void Delete(object id);
|
|
IEnumerable<TEntity> GetAll(string include);
|
|
IEnumerable<TEntity> Get(
|
|
Expression<Func<TEntity, bool>> filter = null,
|
|
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null,
|
|
string includeProperties = "");
|
|
TEntity GetByID(object id);
|
|
void Insert(TEntity entity);
|
|
void Update(TEntity entityToUpdate, bool attach = true);
|
|
IQueryable<TEntity> Include(params Expression<Func<TEntity, object>>[] includes);
|
|
}
|
|
}
|