- 优化 指定 Dto 查询对 c# 字段的支持;

This commit is contained in:
2881099
2021-01-12 12:40:07 +08:00
parent 1e6c6fc9a8
commit fcfeacdc95
3 changed files with 45 additions and 3 deletions

View File

@ -0,0 +1,35 @@
using AME.Helpers;
using FreeSql.DataAnnotations;
using FreeSql.Internal;
using FreeSql.Internal.CommonProvider;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading;
using Xunit;
using static FreeSql.Tests.UnitTest1;
namespace FreeSql.Tests
{
public class UnitTest5
{
[Fact]
public void TestUpdateDyWhere()
{
var fsql = g.sqlite;
var sql = fsql.Update<ts_up_dywhere01>(new { status = "xxx" })
.Set(a => a.status, "yyy")
.ToSql();
Assert.Equal(@"UPDATE ""ts_up_dywhere01"" SET ""status"" = @p_0
WHERE (""status"" = 'xxx')", sql);
}
class ts_up_dywhere01
{
public Guid id { get; set; }
public string status { get; set; }
}
}
}