List<int> sourceNumbers = new List<int> { 2, 4, 8, 16, 32, 64, 128 };
var ram = new Random();
foreach (var source in sourceNumbers)
{
var index = sourceNumbers.IndexOf(source) + 1;
//Console.WriteLine("index=" + index);
List<List<Test>> result = new List<List<Test>>();
string sb = "";
List<string> sb2 = new List<string>();
for (int i = 1; i <= source; i++)
{
List<Test> test = new List<Test>();
List<Test> test2 = new List<Test>();
for (int j = 1; j <= index; j++)
{
test2.Add(new Test() { i = j, b = ram.Next(1, 222) % 2 == 0 });
sb += $"[{test2.Last().b}:{test2.Last().i}]";
//sb2 += $"[{test2.Last().b}:{test2.Last().i}]";
if (j == index)
{
if (sb2.Count > 0 && sb2.Contains(sb))
{
j = 0;
sb = "";
test2 = new List<Test>();
}
else
{
test.AddRange(test2.Select(x => new Test { b = x.b, i = x.i }));
sb2.Add(sb);
sb = "";
}
}
}
test = test.OrderBy(it => it.i).ToList();
result.Add(test);
}
foreach (var test in result)
{
List<string> res = new List<string>();
List<string> res2 = new List<string>();
List<string> res3 = new List<string>();
foreach (var item in test)
{
res3.Add($"include{ item.i}");
if (item.i == 1)
{
if (item.b == false)
{
res.Add($"Expression<Func<T, List<TReturn{item.i }>>> include{item.i}");
}
else
{
res.Add($"Expression<Func<T, TReturn{item.i }>> include{item.i}");
}
}
else
{
if (item.b == false)
{
res.Add($"Expression<Func<TReturn{item.i - 1}, List<TReturn{item.i }>>> include{item.i}");
}
else
{
res.Add($"Expression<Func<TReturn{item.i - 1}, TReturn{item.i }>> include{item.i}");
}
}
res2.Add("TReturn" + (item.i));
}
Console.WriteLine($"public ISugarQueryable<T> Includes<{string.Join(",", res2)}>({string.Join(",", res)}){{ _Includes<T,{string.Join(",", res2)}>(this.Context,{string.Join(",", res3)}); return this; }}");
}
//Console.WriteLine("--");
}
Console.ReadKey();
public class Test
{
public bool b { get; set; }
public int i { get; set; }
}
//1:1 true
//2:
// 1 true , 2 true
// 1 false , 2 true
//3:
// 1 true , 2 true 3 true
// 1 true , 2 false 3 true
// 1 false , 2 false 3 true
// 1 false , 2 true 3 true
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
sqlsugar 是国内最受欢迎的 ORM 框架,支持.NET CORE 和 MySql、SqlServer、Sqlite、Oracle 、 postgresql 、达梦、人大金仓 数据库,具有EF NH的功能,比EF更人性化的语法,支持真实的批量操作,另外还有媲美DAPPER的性能
资源推荐
资源详情
资源评论


























收起资源包目录





































































































共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论


Java程序员-张凯
- 粉丝: 1w+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 基于PLC的升降横移式立体车库设计.doc
- 互联网+助推智慧城市建设201509.ppt
- 热门计算机专业介绍.ppt
- 住宅小区楼宇自动化系统设计方案.doc
- 电子商务公司年终工作总结.pptx
- xx医疗美容医院网络营销方案.pptx
- 精华版最新国家开放大学电大《网络应用服务管理》机考2套真题题库及答案3.pdf
- 电子商务第七章客户关系管理(CRM).ppt
- 网络药理学---副本.pptx
- 整套智能家居系统解决方案样本.doc
- 高大上信息化教学设计说课模板.ppt
- 中国工业软件发展现状与趋势.doc
- 十大智能家居系统解决方案深度推荐.doc
- 人工智能技术介绍--人工智能AI发展分析.pptx
- MicroCommunity-Java资源
- 自行车里程表的设计单片机毕业设计.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
