43 lines
1.4 KiB
C#
43 lines
1.4 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 interface IRepository<T> where T : class
|
|
{
|
|
T Get(Expression<Func<T, bool>> where);
|
|
|
|
IQueryable<T> GetList();
|
|
|
|
IQueryable<T> GetList(Expression<Func<T, bool>> where);
|
|
|
|
IQueryable<T> GetList<TOrderBy>(Expression<Func<T, bool>> where, Expression<Func<T, TOrderBy>> orderBy = null, SortOrder sortOrder = SortOrder.Descending);
|
|
|
|
IQueryable<T> GetList<TOrderBy>(Expression<Func<T, TOrderBy>> orderBy, int pageindex, int pagesize, out int totalRecords, SortOrder sortOrder = SortOrder.Descending);
|
|
|
|
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);
|
|
|
|
IQueryable<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(IEnumerable<T> entities);
|
|
|
|
bool Update(T entity);
|
|
|
|
void Update(IEnumerable<T> entities);
|
|
|
|
void Delete(T entity);
|
|
|
|
void Delete(IEnumerable<T> entities);
|
|
|
|
IQueryable<T> Table { get; }
|
|
|
|
}
|
|
}
|