add AsTable navtive SQL test

This commit is contained in:
28810 2019-04-15 09:18:07 +08:00
parent a60a68cd13
commit 05a40233ee
5 changed files with 14 additions and 0 deletions

View File

@ -759,6 +759,9 @@ namespace FreeSql.Tests.MySql {
[Fact] [Fact]
public void AsTable() { public void AsTable() {
var listt = select.AsTable((a, b) => "(select * from tb_topic where clicks > 10)").Page(1, 10).ToList();
Func<Type, string, string> tableRule = (type, oldname) => { Func<Type, string, string> tableRule = (type, oldname) => {
if (type == typeof(Topic)) return oldname + "AsTable1"; if (type == typeof(Topic)) return oldname + "AsTable1";
else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2"; else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2";

View File

@ -654,6 +654,9 @@ namespace FreeSql.Tests.Oracle {
[Fact] [Fact]
public void AsTable() { public void AsTable() {
var listt = select.AsTable((a, b) => "(select * from tb_topic where clicks > 10)").Page(1, 10).ToList();
Func<Type, string, string> tableRule = (type, oldname) => { Func<Type, string, string> tableRule = (type, oldname) => {
if (type == typeof(Topic)) return oldname + "AsTable1"; if (type == typeof(Topic)) return oldname + "AsTable1";
else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2"; else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2";

View File

@ -724,6 +724,9 @@ namespace FreeSql.Tests.PostgreSQL {
[Fact] [Fact]
public void AsTable() { public void AsTable() {
var listt = select.AsTable((a, b) => "(select * from tb_topic where clicks > 10)").Page(1, 10).ToList();
Func<Type, string, string> tableRule = (type, oldname) => { Func<Type, string, string> tableRule = (type, oldname) => {
if (type == typeof(Topic)) return oldname + "AsTable1"; if (type == typeof(Topic)) return oldname + "AsTable1";
else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2"; else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2";

View File

@ -656,6 +656,9 @@ namespace FreeSql.Tests.SqlServer {
[Fact] [Fact]
public void AsTable() { public void AsTable() {
var listt = select.AsTable((a, b) => "(select * from tb_topic where clicks > 10)").Page(1, 10).ToList();
Func<Type, string, string> tableRule = (type, oldname) => { Func<Type, string, string> tableRule = (type, oldname) => {
if (type == typeof(Topic)) return oldname + "AsTable1"; if (type == typeof(Topic)) return oldname + "AsTable1";
else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2"; else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2";

View File

@ -584,6 +584,8 @@ namespace FreeSql.Tests.Sqlite {
[Fact] [Fact]
public void AsTable() { public void AsTable() {
var listt = select.AsTable((a, b) => "(select * from tb_topic where clicks > 10)").Page(1, 10).ToList();
var tenantId = 1; var tenantId = 1;
var reposTopic = g.sqlite.GetGuidRepository<Topic>(null, oldname => $"{oldname}_{tenantId}"); var reposTopic = g.sqlite.GetGuidRepository<Topic>(null, oldname => $"{oldname}_{tenantId}");
var reposType = g.sqlite.GetGuidRepository<TestTypeInfo>(null, oldname => $"{oldname}_{tenantId}"); var reposType = g.sqlite.GetGuidRepository<TestTypeInfo>(null, oldname => $"{oldname}_{tenantId}");