mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 补充 fsql.InsertOrUpdate UpdateColumns 数据存在时只更新指定的字段;
This commit is contained in:
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user