Browse Source

Includes

pull/15/MERGE
sunkaixuan 3 years ago
parent
commit
4d2abd2f32
  1. 85
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/IncludesHelper.cs

85
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/IncludesHelper.cs

@ -33,28 +33,93 @@ namespace SqlSugar
}
private void _Includes<T1, TReturn1, TReturn2, TReturn3>(SqlSugarProvider context, params Expression[] expressions)
{
throw new NotImplementedException();
Func<ISugarQueryable<object>, List<object>> SelectR1 = it => it.Select<TReturn1>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR2 = it => it.Select<TReturn2>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR3 = it => it.Select<TReturn3>().ToList().Select(x => x as object).ToList();
var navigat = new NavigatManager<T>();
navigat.SelectR1 = SelectR1;
navigat.SelectR2 = SelectR2;
navigat.SelectR3 = SelectR3;
navigat.Expressions = expressions;
navigat.Context = this.Context;
if (this.QueryBuilder.Includes == null) this.QueryBuilder.Includes = new List<object>();
this.QueryBuilder.Includes.Add(navigat);
}
private void _Includes<T1, TReturn1, TReturn2, TReturn3, TReturn4>(SqlSugarProvider context, params Expression[] expressions)
{
throw new NotImplementedException();
Func<ISugarQueryable<object>, List<object>> SelectR1 = it => it.Select<TReturn1>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR2 = it => it.Select<TReturn2>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR3 = it => it.Select<TReturn3>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR4 = it => it.Select<TReturn4>().ToList().Select(x => x as object).ToList();
var navigat = new NavigatManager<T>();
navigat.SelectR1 = SelectR1;
navigat.SelectR2 = SelectR2;
navigat.SelectR3 = SelectR3;
navigat.SelectR4 = SelectR4;
navigat.Expressions = expressions;
navigat.Context = this.Context;
if (this.QueryBuilder.Includes == null) this.QueryBuilder.Includes = new List<object>();
this.QueryBuilder.Includes.Add(navigat);
}
private void _Includes<T1, TReturn1, TReturn2, TReturn3, TReturn4, TReturn5>(SqlSugarProvider context, params Expression[] expressions)
{
throw new NotImplementedException();
Func<ISugarQueryable<object>, List<object>> SelectR1 = it => it.Select<TReturn1>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR2 = it => it.Select<TReturn2>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR3 = it => it.Select<TReturn3>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR4 = it => it.Select<TReturn4>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR5 = it => it.Select<TReturn5>().ToList().Select(x => x as object).ToList();
var navigat = new NavigatManager<T>();
navigat.SelectR1 = SelectR1;
navigat.SelectR2 = SelectR2;
navigat.SelectR3 = SelectR3;
navigat.SelectR4 = SelectR4;
navigat.SelectR5 = SelectR5;
navigat.Expressions = expressions;
navigat.Context = this.Context;
if (this.QueryBuilder.Includes == null) this.QueryBuilder.Includes = new List<object>();
this.QueryBuilder.Includes.Add(navigat);
}
private void _Includes<T1, TReturn1, TReturn2, TReturn3, TReturn4, TReturn5, TReturn6>(SqlSugarProvider context, params Expression[] expressions)
{
throw new NotImplementedException();
Func<ISugarQueryable<object>, List<object>> SelectR1 = it => it.Select<TReturn1>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR2 = it => it.Select<TReturn2>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR3 = it => it.Select<TReturn3>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR4 = it => it.Select<TReturn4>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR5 = it => it.Select<TReturn5>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR6 = it => it.Select<TReturn6>().ToList().Select(x => x as object).ToList();
var navigat = new NavigatManager<T>();
navigat.SelectR1 = SelectR1;
navigat.SelectR2 = SelectR2;
navigat.SelectR3 = SelectR3;
navigat.SelectR4 = SelectR4;
navigat.SelectR5 = SelectR5;
navigat.SelectR6 = SelectR6;
navigat.Expressions = expressions;
navigat.Context = this.Context;
if (this.QueryBuilder.Includes == null) this.QueryBuilder.Includes = new List<object>();
this.QueryBuilder.Includes.Add(navigat);
}
private void _Includes<T1, TReturn1, TReturn2, TReturn3, TReturn4, TReturn5, TReturn6, TReturn7>(SqlSugarProvider context, params Expression[] expressions)
{
throw new NotImplementedException();
}
private void _Includes<T1, TReturn1, TReturn2, TReturn3, TReturn4, TReturn5, TReturn6, TReturn7, TReturn8>(SqlSugarProvider context, params Expression[] expressions)
{
throw new NotImplementedException();
Func<ISugarQueryable<object>, List<object>> SelectR1 = it => it.Select<TReturn1>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR2 = it => it.Select<TReturn2>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR3 = it => it.Select<TReturn3>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR4 = it => it.Select<TReturn4>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR5 = it => it.Select<TReturn5>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR6 = it => it.Select<TReturn6>().ToList().Select(x => x as object).ToList();
Func<ISugarQueryable<object>, List<object>> SelectR7 = it => it.Select<TReturn7>().ToList().Select(x => x as object).ToList();
var navigat = new NavigatManager<T>();
navigat.SelectR1 = SelectR1;
navigat.SelectR2 = SelectR2;
navigat.SelectR3 = SelectR3;
navigat.SelectR4 = SelectR4;
navigat.SelectR5 = SelectR5;
navigat.SelectR6 = SelectR6;
navigat.SelectR7 = SelectR7;
navigat.Expressions = expressions;
navigat.Context = this.Context;
if (this.QueryBuilder.Includes == null) this.QueryBuilder.Includes = new List<object>();
this.QueryBuilder.Includes.Add(navigat);
}
}
}

Loading…
Cancel
Save