This commit is contained in:
610262374@qq.com
2017-03-16 09:59:32 +08:00
parent b92bdb6740
commit c9051ddbd4
3 changed files with 38 additions and 26 deletions

View File

@@ -37,7 +37,7 @@ namespace OrmTest.UnitTest
var list = db.Queryable<School,School>((st,st2)=>new object[] {
JoinType.Left,st.Id==st2.Id
})
.Where(st => st.Id > 0)
.Where<Student,School>((st,sc) => st.Id > 0)
.Select(st => new ViewModelStudent { School=st}).ToList();
var list2 = db.Queryable<Student>()

View File

@@ -77,26 +77,26 @@ namespace SqlSugar
return this;
}
public ISugarQueryable<T> Where<T2>(Expression<Func<T, T2, bool>> expression) where T2 : class, new()
public ISugarQueryable<T> Where<T2>(Expression<Func<T2, bool>> expression) where T2 : class, new()
{
throw new NotImplementedException();
return this;
}
public ISugarQueryable<T> Where<T2, T3>(Expression<Func<T, T2, T3, bool>> expression) where T2 : class, new() where T3 : class, new()
public ISugarQueryable<T> Where<T2, T3>(Expression<Func<T2, T3, bool>> expression) where T2 : class, new() where T3 : class, new()
{
throw new NotImplementedException();
return this;
}
public ISugarQueryable<T> Where<T2, T3, T4>(Expression<Func<T, T2, T3, T4, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new()
public ISugarQueryable<T> Where<T2, T3, T4>(Expression<Func<T2, T3, T4, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new()
{
throw new NotImplementedException();
return this;
}
public ISugarQueryable<T> Where<T2, T3, T4, T5>(Expression<Func<T, T2, T3, T4, T5, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new() where T5 : class, new()
public ISugarQueryable<T> Where<T2, T3, T4, T5>(Expression<Func<T2, T3, T4, T5, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new() where T5 : class, new()
{
throw new NotImplementedException();
return this;
}
public ISugarQueryable<T> Where<T2, T3, T4, T5, T6>(Expression<Func<T2, T3, T4, T5, T6, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new() where T5 : class, new() where T6 : class, new()
{
return this;
}
public ISugarQueryable<T> In(params object[] pkValues)
{
throw new NotImplementedException();
@@ -212,22 +212,30 @@ namespace SqlSugar
throw new NotImplementedException();
}
public ISugarQueryable<TResult> Select<T2, TResult>(Expression<Func<T, T2, TResult>> expression) where TResult : class, new()
public ISugarQueryable<TResult> Select<T2, TResult>(Expression<Func<T2, TResult>> expression) where TResult : class, new()
{
throw new NotImplementedException();
}
public ISugarQueryable<TResult> Select<T2, T3, TResult>(Expression<Func<T, T2, T3, TResult>> expression) where TResult : class, new()
public ISugarQueryable<TResult> Select<T2, T3, TResult>(Expression<Func<T2, T3, TResult>> expression) where TResult : class, new()
{
throw new NotImplementedException();
}
public ISugarQueryable<TResult> Select<T2, T3, T4, TResult>(Expression<Func<T, T2, T3, T4, TResult>> expression) where TResult : class, new()
public ISugarQueryable<TResult> Select<T2, T3, T4, TResult>(Expression<Func<T2, T3, T4, TResult>> expression) where TResult : class, new()
{
throw new NotImplementedException();
}
public ISugarQueryable<TResult> Select<T2, T3, T4, T5, TResult>(Expression<Func<T, T2, T3, T4, T5, TResult>> expression) where TResult : class, new()
public ISugarQueryable<TResult> Select<T2, T3, T4, T5, TResult>(Expression<Func<T2, T3, T4, T5, TResult>> expression) where TResult : class, new()
{
throw new NotImplementedException();
}
public ISugarQueryable<TResult> Select<T2, T3, T4, T5, T6, TResult>(Expression<Func<T2, T3, T4, T5, T6, TResult>> expression) where TResult : class, new()
{
throw new NotImplementedException();
}
public ISugarQueryable<TResult> Select<T2, T3, T4, T5, T6, T7, TResult>(Expression<Func<T2, T3, T4, T5, T6, T7, TResult>> expression) where TResult : class, new()
{
throw new NotImplementedException();
}
@@ -338,5 +346,7 @@ namespace SqlSugar
{
throw new NotImplementedException();
}
}
}

View File

@@ -19,11 +19,11 @@ namespace SqlSugar
ISugarQueryable<T> Where(Expression<Func<T, bool>> expression);
ISugarQueryable<T> Where(string whereString, object whereObj = null);
ISugarQueryable<T> Where<T2>(string whereString, object whereObj = null) where T2 : class, new();
ISugarQueryable<T> Where<T2>(Expression<Func<T, T2, bool>> expression) where T2 : class, new();
ISugarQueryable<T> Where<T2, T3>(Expression<Func<T, T2, T3, bool>> expression) where T2 : class, new() where T3 : class, new();
ISugarQueryable<T> Where<T2, T3, T4>(Expression<Func<T, T2, T3, T4, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new();
ISugarQueryable<T> Where<T2, T3, T4, T5>(Expression<Func<T, T2, T3, T4, T5, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new() where T5 : class, new();
ISugarQueryable<T> Where<T2>(Expression<Func<T2, bool>> expression) where T2 : class, new();
ISugarQueryable<T> Where<T2, T3>(Expression<Func<T2, T3, bool>> expression) where T2 : class, new() where T3 : class, new();
ISugarQueryable<T> Where<T2, T3, T4>(Expression<Func<T2, T3, T4, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new();
ISugarQueryable<T> Where<T2, T3, T4, T5>(Expression<Func<T2, T3, T4, T5, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new() where T5 : class, new();
ISugarQueryable<T> Where<T2, T3, T4, T5, T6>(Expression<Func<T2, T3, T4, T5, T6, bool>> expression) where T2 : class, new() where T3 : class, new() where T4 : class, new() where T5 : class, new() where T6 : class, new();
ISugarQueryable<T> In(params object[] pkValues);
T InSingle(object pkValue);
@@ -54,10 +54,12 @@ namespace SqlSugar
T FirstOrDefault(Expression<Func<T, bool>> expression);
bool Any(Expression<Func<T, bool>> expression);
bool Any();
ISugarQueryable<TResult> Select<T2, TResult>(Expression<Func<T, T2, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, T3, TResult>(Expression<Func<T, T2, T3, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, T3, T4, TResult>(Expression<Func<T, T2, T3, T4, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, T3, T4, T5, TResult>(Expression<Func<T, T2, T3, T4, T5, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, TResult>(Expression<Func<T2, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, T3, TResult>(Expression<Func<T2, T3, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, T3, T4, TResult>(Expression<Func<T2, T3, T4, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, T3, T4, T5, TResult>(Expression<Func<T2, T3, T4, T5, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, T3, T4, T5,T6, TResult>(Expression<Func<T2, T3, T4, T5,T6, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<T2, T3, T4, T5, T6,T7, TResult>(Expression<Func<T2, T3, T4, T5, T6,T7, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<TResult>(Expression<Func<T, TResult>> expression) where TResult : class, new();
ISugarQueryable<TResult> Select<TResult>(string select) where TResult : class, new();
ISugarQueryable<T> Select(string select);