update

2881099
2021-01-21 11:11:14 +08:00
parent eaa03e7b6f
commit edc677368f
4 changed files with 12 additions and 12 deletions

@@ -52,7 +52,7 @@ fsql.CodeFirst.ConfigEntity<实体类>(a => a
如何检测一个导航属性是否配置生效:
```csharp
var tbref = g.sqlite.CodeFirst
var tbref = fsql.CodeFirst
.GetTableByEntity(typeof(T))
.GetTableRef("Children", true);
```

@@ -118,14 +118,14 @@ public void QueryEntity() {
time.Restart();
List<Song> dplist1 = null;
using (var conn = g.mysql.Ado.MasterPool.Get()) {
using (var conn = fsql.Ado.MasterPool.Get()) {
dplist1 = Dapper.SqlMapper.Query<Song>(conn.Value, "select * from song").ToList();
}
time.Stop();
sb.AppendLine($"Elapsed: {time.Elapsed}; Query Entity Counts: {dplist1.Count}; ORM: Dapper");
time.Restart();
var t3 = g.mysql.Ado.Query<Song>("select * from song");
var t3 = fsql.Ado.Query<Song>("select * from song");
time.Stop();
sb.AppendLine($"Elapsed: {time.Elapsed}; Query Entity Counts: {t3.Count}; ORM: FreeSql*");
}
@@ -141,14 +141,14 @@ public void QueryTuple() {
time.Restart();
List<(int, string, string)> dplist2 = null;
using (var conn = g.mysql.Ado.MasterPool.Get()) {
using (var conn = fsql.Ado.MasterPool.Get()) {
dplist2 = Dapper.SqlMapper.Query<(int, string, string)>(conn.Value, "select * from song").ToList();
}
time.Stop();
sb.AppendLine($"Elapsed: {time.Elapsed}; Query Tuple Counts: {dplist2.Count}; ORM: Dapper");
time.Restart();
var t4 = g.mysql.Ado.Query<(int, string, string)>("select * from song");
var t4 = fsql.Ado.Query<(int, string, string)>("select * from song");
time.Stop();
sb.AppendLine($"Elapsed: {time.Elapsed}; Query Tuple Counts: {t4.Count}; ORM: FreeSql*");
}
@@ -164,14 +164,14 @@ public void QueryDynamic() {
time.Restart();
List<dynamic> dplist3 = null;
using (var conn = g.mysql.Ado.MasterPool.Get()) {
using (var conn = fsql.Ado.MasterPool.Get()) {
dplist3 = Dapper.SqlMapper.Query<dynamic>(conn.Value, "select * from song").ToList();
}
time.Stop();
sb.AppendLine($"Elapsed: {time.Elapsed}; Query Dynamic Counts: {dplist3.Count}; ORM: Dapper");
time.Restart();
var t5 = g.mysql.Ado.Query<dynamic>("select * from song");
var t5 = fsql.Ado.Query<dynamic>("select * from song");
time.Stop();
sb.AppendLine($"Elapsed: {time.Elapsed}; Query Dynamic Counts: {t5.Count}; ORM: FreeSql*");
}
@@ -186,13 +186,13 @@ public void QueryList() {
var time = new Stopwatch();
time.Restart();
var t3 = g.mysql.Select<Song>().ToList();
var t3 = fsql.Select<Song>().ToList();
time.Stop();
sb.AppendLine($"Elapsed: {time.Elapsed}; ToList Entity Counts: {t3.Count}; ORM: FreeSql*");
time.Restart();
List<Song> dplist1 = null;
using (var conn = g.mysql.Ado.MasterPool.Get()) {
using (var conn = fsql.Ado.MasterPool.Get()) {
dplist1 = Dapper.SqlMapper.Query<Song>(conn.Value, "select * from song").ToList();
}
time.Stop();

@@ -615,7 +615,7 @@ fsql.CodeFirst.SyncStructure(typeof(Log), "Log_2"); //迁移到 Log_2 表
## v0.10.8
- 增加 List\<T1\> 扩展方法 IncludeMany实现从已知的内存 List 数据,进行和 ISelect.IncludeMany 相同功能的贪婪加载;
> 示例new List\<Song\>(new[] { song1, song2, song3 }).IncludeMany(g.sqlite, a => a.Tags);
> 示例new List\<Song\>(new[] { song1, song2, song3 }).IncludeMany(fsql, a => a.Tags);
> 文档:%e8%b4%aa%e5%a9%aa%e5%8a%a0%e8%bd%bd#%E5%AF%BC%E8%88%AA%E5%B1%9E%E6%80%A7-onetomanymanytomany
- 修复 FreeSql.DbContext/FreeSql.Repository 当主键为 Guid? 可空类型时,发生参数错误;

@@ -52,7 +52,7 @@ class CagetoryParent {
[Fact]
public void EnableAddOrUpdateNavigateList_OneToMany_Parent() {
var repo = g.sqlite.GetRepository<CagetoryParent>();
var repo = fsql.GetRepository<CagetoryParent>();
repo.DbContextOptions.EnableAddOrUpdateNavigateList = true;
var cts = new[] {
new CagetoryParent
@@ -154,7 +154,7 @@ public void EnableAddOrUpdateNavigateList_ManyToMany() {
})
}
};
var repo = g.sqlite.GetRepository<Song>();
var repo = fsql.GetRepository<Song>();
repo.DbContextOptions.EnableAddOrUpdateNavigateList = true;
repo.Insert(ss);
//INSERT INTO "EAUNL_MTM_SONG"("Id", "Name") VALUES('5d90fdb3-6a6b-2c58-00c8-37974177440d', '爱你一万年.mp3'), ('5d90fdb3-6a6b-2c58-00c8-37987f29b197', '李白.mp3')