41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlClient;
|
|
using System.Linq.Expressions;
|
|
using WX.CRM.Common;
|
|
|
|
namespace WX.CRM.IBLL
|
|
{
|
|
public interface IRepository<T> : IDisposable where T : class
|
|
{
|
|
T Get(Expression<Func<T, bool>> where);
|
|
|
|
IEnumerable<T> GetList();
|
|
|
|
IEnumerable<T> GetList(Expression<Func<T, bool>> where);
|
|
|
|
IEnumerable<T> GetList<TOrderBy>(Expression<Func<T, bool>> where, Expression<Func<T, TOrderBy>> orderBy = null, SortOrder sortOrder = SortOrder.Descending);
|
|
|
|
IEnumerable<T> GetList<TOrderBy>(Expression<Func<T, TOrderBy>> orderBy, int pageindex, int pagesize, out int totalRecords
|
|
, SortOrder sortOrder = SortOrder.Descending);
|
|
|
|
IEnumerable<T> GetList<TOrderBy>(Expression<Func<T, bool>> where, Expression<Func<T, TOrderBy>> orderBy,
|
|
int pageindex, int pagesize, out int totalRecords, SortOrder sortOrder = SortOrder.Descending);
|
|
|
|
IEnumerable<T> GetList<TOrderBy>(Expression<Func<T, bool>> where, Expression<Func<T, TOrderBy>> orderBy,
|
|
Pager pg, SortOrder sortOrder = SortOrder.Descending);
|
|
|
|
int Add(T entity);
|
|
|
|
void AddList(List<T> list);
|
|
|
|
bool Update(T obj);
|
|
|
|
void Delete(T obj);
|
|
|
|
bool Delete(Expression<Func<T, bool>> where);
|
|
|
|
bool Exists(Expression<Func<T, bool>> where);
|
|
}
|
|
}
|