- 补充 fsql.InsertOrUpdate UpdateColumns 数据存在时只更新指定的字段;

This commit is contained in:
28810
2020-07-29 15:32:14 +08:00
parent a8d1db8614
commit 06b301395f
19 changed files with 89 additions and 26 deletions

View File

@ -296,6 +296,7 @@ namespace FreeSql.Tests
public void EnableAddOrUpdateNavigateList_OneToMany()
{
var repo = g.sqlite.GetRepository<Cagetory>();
repo.DbContextOptions.EnableAddOrUpdateNavigateList = true;
var cts = new[] {
new Cagetory
{

View File

@ -159,6 +159,8 @@ namespace FreeSql.Tests
[Fact]
public void Test03()
{
var sqlxx = g.pgsql.InsertOrUpdate<userinfo>().SetSource(new userinfo { userid = 10 }).UpdateColumns(a => new { a.birthday, a.CardNo }).ToSql();
var aff1 = g.sqlite.GetRepository<Edi, long>().Delete(10086);
var aff2 = g.sqlite.Delete<Edi>(10086).ExecuteAffrows();
Assert.Equal(aff1, aff2);