- 修复 8c72d54025 ToList<Dto> jsonb 映射,影响 v3.2.600 ;

This commit is contained in:
2881099
2022-04-28 13:00:24 +08:00
parent 1f01ea9c90
commit 1b289c7d08
3 changed files with 38 additions and 4 deletions

View File

@ -1864,6 +1864,25 @@ WHERE (((cast(a.[Id] as nvarchar(100))) in (SELECT TOP 10 b.[Title]
Assert.Equal("SELECT TOP 1 a.[id], a.[name] FROM [ToUpd1Pk] a With(UpdLock, RowLock, NoWait)", sql);
orm.Select<ToUpd1Pk>().WithLock(SqlServerLock.UpdLock | SqlServerLock.RowLock | SqlServerLock.NoWait).Limit(1).ToList();
});
var sql2 = orm.Select<Topic>()
.InnerJoin(a => a.Type.Guid == a.Id)
.WithLock()
.ToSql();
Assert.Equal(@"SELECT a.[Id], a.[Clicks], a.[TypeGuid], a__Type.[Guid], a__Type.[ParentId], a__Type.[Name], a.[Title], a.[CreateTime]
FROM [tb_topic22] a With(NoLock)
INNER JOIN [TestTypeInfo] a__Type With(NoLock) ON a__Type.[Guid] = a.[Id]", sql2);
sql2 = orm.Select<Topic>()
.InnerJoin(a => a.Type.Guid == a.Id)
.WithLock(SqlServerLock.NoLock, new Dictionary<Type, bool>
{
[typeof(TestTypeInfo)] = true
})
.ToSql();
Assert.Equal(@"SELECT a.[Id], a.[Clicks], a.[TypeGuid], a__Type.[Guid], a__Type.[ParentId], a__Type.[Name], a.[Title], a.[CreateTime]
FROM [tb_topic22] a
INNER JOIN [TestTypeInfo] a__Type With(NoLock) ON a__Type.[Guid] = a.[Id]", sql2);
}
[Fact]
public void ForUpdate()