内部 ColumnInfo 调整

This commit is contained in:
28810
2020-08-18 18:14:02 +08:00
parent 90b6d76510
commit 8cec3e396b
31 changed files with 223 additions and 102 deletions

View File

@ -332,6 +332,9 @@ namespace FreeSql.Tests
cts[1].Goodss.Add(new Goods { Name = "<22><>Ʒ55" });
repo.Update(cts);
var cts2 = repo.Select.WhereDynamic(cts).IncludeMany(a => a.Goodss).ToList();
cts2[0].Goodss[0].Name += 123;
repo.Update(cts2[0]);
}
[Table(Name = "EAUNL_OTM_CT")]
class Cagetory
@ -490,7 +493,9 @@ namespace FreeSql.Tests
var repo = g.sqlite.GetRepository<Song>();
repo.DbContextOptions.EnableAddOrUpdateNavigateList = true; //<2F>򿪼<EFBFBD><F2BFAABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B9A6>
repo.Insert(ss);
//repo.SaveMany(ss[0], "Tags"); //ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Tags <20><><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
ss[0].Tags[0].TagName = "<22><><EFBFBD><EFBFBD>101";
repo.SaveMany(ss[0], "Tags"); //ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Tags <20><><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
ss[0].Name = "<22><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>.mp5";
ss[0].Tags.Clear();

View File

@ -1,8 +1,10 @@
using FreeSql.DataAnnotations;
using FreeSql.Internal.CommonProvider;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Intrinsics.X86;
using Xunit;
namespace FreeSql.Tests.MySql
@ -1311,6 +1313,15 @@ WHERE ((b.`IsFinished` OR a.`TaskType` = 3) AND b.`EnabledMark` = 1)", groupsql1
};
Assert.Equal(5, g.mysql.Insert(model4s).ExecuteAffrows());
var sel = g.mysql.Select<TestInclude_OneToManyModel2, TestInclude_OneToManyModel3>();
//var tb1 = (sel as Select0Provider)._tables[1];
//tb1.Type = Internal.Model.SelectTableInfoType.LeftJoin;
//tb1.On = $"b.id = ({g.mysql.Select<TestInclude_OneToManyModel3>().As("b2").Where("a.model2id = model2111Idaaa").Limit(1).ToSql("id")})";
var sql = sel
.LeftJoin((a,b) => b.id == g.mysql.Select<TestInclude_OneToManyModel3>().As("b2").Where(b2 => a.model2id == b2.model2111Idaaa).First(b2 => b2.id))
.ToSql((a, b) => new { a, b });
var t0 = g.mysql.Select<TestInclude_OneToManyModel2>()
.IncludeMany(a => a.childs.Where(m3 => m3.model2111Idaaa == a.model2id))
.Where(a => a.model2id <= model1.id)