mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
add AsTable navtive SQL test
This commit is contained in:
parent
a60a68cd13
commit
05a40233ee
@ -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";
|
||||||
|
@ -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";
|
||||||
|
@ -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";
|
||||||
|
@ -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";
|
||||||
|
@ -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}");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user