diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs index 9bdecdaf5..ec05ed163 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs @@ -31,6 +31,7 @@ namespace OrmTest } public static void Init() { + UCustom024.Init(); UCustom24.Init(); UCustom20.Init(); UTran2.Init(); diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom024.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom024.cs index 53094e9e0..9620dca20 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom024.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom024.cs @@ -17,10 +17,24 @@ namespace OrmTest var list=db.Queryable().Take(2).ToList(); db.Updateable(list).ExecuteCommand(); db.Deleteable(list).ExecuteCommand(); + var p = new TestModel2(); + db.Queryable().Where(z => z.Id != p.Id).ToList(); + var p2 = new Order(); + db.Queryable().Where(z => z.Id != p2.Id).ToList(); } } + public class TestModel + { + public virtual long? Id { get; set; } + } + + public class TestModel2 : TestModel + { + // 关键就是这个地方 + public new long Id { get; set; } + } public class UnitNewP: UnitBaseP { [SqlSugar.SugarColumn(IsPrimaryKey =true)]