Mini.Crm/Mini.Model/EfRepositoryBase.cs

42 lines
1.6 KiB
C#

using Mini.Common;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace Mini.Model
{
public abstract class EfRepositoryBase<T> : IRepository<T> where T : BaseEntity
{
public abstract T Get(Expression<Func<T, bool>> @where);
public abstract IQueryable<T> GetList();
public abstract IQueryable<T> GetList(Expression<Func<T, bool>> @where);
public abstract IQueryable<T> GetList<TOrderBy>(Expression<Func<T, bool>> @where, Expression<Func<T, TOrderBy>> orderBy = null, SortOrder sortOrder = SortOrder.Descending);
public abstract IQueryable<T> GetList<TOrderBy>(Expression<Func<T, TOrderBy>> orderBy, int pageindex, int pagesize, out int totalRecords, SortOrder sortOrder = SortOrder.Descending);
public abstract IQueryable<T> GetList<TOrderBy>(Expression<Func<T, bool>> @where, Expression<Func<T, TOrderBy>> orderBy, int pageindex, int pagesize, out int totalRecords, SortOrder sortOrder = SortOrder.Descending);
public abstract IQueryable<T> GetList<TOrderBy>(Expression<Func<T, bool>> @where, Expression<Func<T, TOrderBy>> orderBy, Pager pg, SortOrder sortOrder = SortOrder.Descending);
public abstract int Add(T entity);
public abstract void AddList(IEnumerable<T> entities);
public abstract bool Update(T entity);
public abstract void Update(IEnumerable<T> entities);
public abstract void Delete(T entity);
public abstract void Delete(IEnumerable<T> entities);
public abstract IQueryable<T> Table { get; }
}
}