diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs index c941f6c9e..77b0a05c7 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs @@ -105,7 +105,27 @@ namespace OrmTest var list3=db.Queryable().ToList(); - //db.Insertable>(new ApiLog(1) { RequestUser="a"}).ExecuteCommand(); + + db.MappingTables = new MappingTableList(); + db.MappingTables.Add("a", "b"); + db.MappingTables.Add("c", "d"); + db.CodeFirst.As("ApiLog0001").InitTables(); + db.Queryable().AS("ApiLog0001").ToList(); + db.CodeFirst.As("ApiLog0002").InitTables(); + db.Queryable().AS("ApiLog0002").ToList(); + db.Queryable().ToList(); + if (db.MappingTables.Count != 2) + { + throw new Exception("unit error"); + } + if (db.MappingTables.First(it=>it.EntityName=="a").DbTableName!="b") + { + throw new Exception("unit error"); + } + if (db.MappingTables.First(it => it.EntityName == "c").DbTableName != "d") + { + throw new Exception("unit error"); + } } ///