- 修复 <object> + AsType + (a as BaseEntity) 解析问题;#1427

This commit is contained in:
2881099
2023-05-23 22:25:14 +08:00
parent 6fedb20673
commit 6b84bd79ae
3 changed files with 21 additions and 11 deletions

View File

@ -1,4 +1,4 @@
using FreeSql.DataAnnotations;
using FreeSql.DataAnnotations;
using FreeSql.Tests.DataContext.SqlServer;
using System;
using System.Collections.Generic;
@ -30,6 +30,25 @@ namespace FreeSql.Tests.SqlServer
public DateTime CreateTime { get; set; }
}
abstract class EntityBase
{
public int Id { get; set; }
}
class SysDictionnary : EntityBase
{
public string Name { get; set; }
}
[Fact]
public void AsType()
{
var fsql = g.sqlserver;
var delsid = new[] { 1, 2, 3, 4 };
var sqlsss22222 = fsql.Delete<object>().AsType(typeof(SysDictionnary))
.Where(o => delsid.Contains((o as EntityBase).Id))
.ToSql();
}
[Fact]
public void Dywhere()
{