mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-04 15:30:53 +08:00
update
@@ -213,6 +213,15 @@ fsql.Select<Topic>().ToList(a => new
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.TopicId == a.Id).ToList()
|
||||
});
|
||||
|
||||
fsql.Select<Topic>()
|
||||
.GroupBy(a => new { a.Author })
|
||||
.WithTempQuery(a => new { Author = a.Key.Author, Count = a.Count() })
|
||||
.ToList(a => new {
|
||||
a.Author, a.Count,
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.Author == a.Author).ToList()
|
||||
});
|
||||
```
|
||||
|
||||
## 10. Collection properties
|
||||
|
||||
@@ -73,11 +73,19 @@ List<ANONYMOUS_TYPE> t10 = fsql.Select<Topic>().ToList(a => new {
|
||||
});
|
||||
|
||||
//Return the records of the subquery v3.2.650+
|
||||
List<匿名类> t11 = fsql.Select<Topic>().ToList(a => new {
|
||||
List<ANONYMOUS_TYPE> t11 = fsql.Select<Topic>().ToList(a => new {
|
||||
a.Id,
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.TopicId == a.Id).ToList()
|
||||
});
|
||||
List<ANONYMOUS_TYPE> t12 = fsql.Select<Topic>()
|
||||
.GroupBy(a => new { a.Author })
|
||||
.WithTempQuery(a => new { Author = a.Key.Author, Count = a.Count() })
|
||||
.ToList(a => new {
|
||||
a.Author, a.Count,
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.Author == a.Author).ToList()
|
||||
});
|
||||
```
|
||||
|
||||
> In the early constant mechanism, we left it to raw SQL. If you really need to return the string, you can write: "'xxx'"
|
||||
|
||||
9
多表查询.md
9
多表查询.md
@@ -185,6 +185,15 @@ fsql.Select<Topic>().ToList(a => new
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.TopicId == a.Id).ToList()
|
||||
});
|
||||
|
||||
fsql.Select<Topic>()
|
||||
.GroupBy(a => new { a.Author })
|
||||
.WithTempQuery(a => new { Author = a.Key.Author, Count = a.Count() })
|
||||
.ToList(a => new {
|
||||
a.Author, a.Count,
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.Author == a.Author).ToList()
|
||||
});
|
||||
```
|
||||
|
||||
## 10、集合属性
|
||||
|
||||
9
表达式函数.md
9
表达式函数.md
@@ -188,6 +188,15 @@ fsql.Select<Topic>().ToList(a => new
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.TopicId == a.Id).ToList()
|
||||
});
|
||||
|
||||
fsql.Select<Topic>()
|
||||
.GroupBy(a => new { a.Author })
|
||||
.WithTempQuery(a => new { Author = a.Key.Author, Count = a.Count() })
|
||||
.ToList(a => new {
|
||||
a.Author, a.Count,
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.Author == a.Author).ToList()
|
||||
});
|
||||
```
|
||||
|
||||
## 自定义解析
|
||||
|
||||
8
返回数据.md
8
返回数据.md
@@ -67,6 +67,14 @@ List<匿名类> t11 = fsql.Select<Topic>().ToList(a => new {
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.TopicId == a.Id).ToList()
|
||||
});
|
||||
List<匿名类> t12 = fsql.Select<Topic>()
|
||||
.GroupBy(a => new { a.Author })
|
||||
.WithTempQuery(a => new { Author = a.Key.Author, Count = a.Count() })
|
||||
.ToList(a => new {
|
||||
a.Author, a.Count,
|
||||
list1 = fsql.Select<T2>().ToList(),
|
||||
list2 = fsql.Select<T2>().Where(b => b.Author == a.Author).ToList()
|
||||
});
|
||||
```
|
||||
|
||||
> 常量机制早期留给了原生SQL,如果真的需要返回该字符串:"'xxx'"
|
||||
|
||||
Reference in New Issue
Block a user