增加mysql支持

This commit is contained in:
yubaolee
2016-04-01 17:12:33 +08:00
parent 068e6a4bac
commit 38e2628b15
6 changed files with 562 additions and 82 deletions

View File

@@ -21,7 +21,7 @@ namespace OpenAuth.Domain.Interface
public interface IRepository<T> where T : class
{
T FindSingle(Expression<Func<T, bool>> exp = null);
bool IsExist(Expression<Func<T, bool>> exp);
IQueryable<T> Find(Expression<Func<T, bool>> exp = null);
IQueryable<T> Find(int pageindex = 1, int pagesize = 10, string orderby = "",
@@ -31,6 +31,8 @@ namespace OpenAuth.Domain.Interface
void Add(T entity);
void BatchAdd(T[] entities);
/// <summary>
/// 更新一个实体的所有属性
/// </summary>
@@ -39,10 +41,17 @@ namespace OpenAuth.Domain.Interface
void Delete(T entity);
/// <summary>
/// 批量更新
/// 按指定的ID进行批量更新
/// </summary>
void Update(Expression<Func<T, object>> exp, T entity);
void Update(Expression<Func<T, object>> identityExp, T entity);
/// <summary>
/// 实现按需要只更新部分更新
/// <para>如Update(u =>u.Id==1,u =>new User{Name="ok"});</para>
/// </summary>
/// <param name="where">更新条件</param>
/// <param name="entity">更新后的实体</param>
void Update(Expression<Func<T, bool>> where, Expression<Func<T, T>> entity);
/// <summary>
/// 批量删除
/// </summary>