mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
Catalog arrangement
This commit is contained in:
20
Src/Asp.Net/SqlServerTest/UnitTest/Setting/Attribute.cs
Normal file
20
Src/Asp.Net/SqlServerTest/UnitTest/Setting/Attribute.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.UnitTest
|
||||
{
|
||||
public class Attribute : UnitTestBase
|
||||
{
|
||||
public Attribute(int eachCount)
|
||||
{
|
||||
this.Count = eachCount;
|
||||
}
|
||||
public void Init()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
32
Src/Asp.Net/SqlServerTest/UnitTest/Setting/AutoClose.cs
Normal file
32
Src/Asp.Net/SqlServerTest/UnitTest/Setting/AutoClose.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using OrmTest.Models;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.UnitTest
|
||||
{
|
||||
public class AutoClose : UnitTestBase
|
||||
{
|
||||
public AutoClose(int eachCount)
|
||||
{
|
||||
this.Count = eachCount;
|
||||
}
|
||||
public void Init()
|
||||
{
|
||||
//IsAutoCloseConnection
|
||||
for (int i = 0; i < this.Count; i++)
|
||||
{
|
||||
var db = GetInstance();
|
||||
var x = db.Queryable<Student>().ToList();
|
||||
}
|
||||
}
|
||||
public SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
|
||||
return db;
|
||||
}
|
||||
}
|
||||
}
|
18
Src/Asp.Net/SqlServerTest/UnitTest/Setting/MapColumn.cs
Normal file
18
Src/Asp.Net/SqlServerTest/UnitTest/Setting/MapColumn.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.UnitTest
|
||||
{
|
||||
public class MapColumn : UnitTestBase
|
||||
{
|
||||
public SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
|
||||
return db;
|
||||
}
|
||||
}
|
||||
}
|
28
Src/Asp.Net/SqlServerTest/UnitTest/Setting/MapTable.cs
Normal file
28
Src/Asp.Net/SqlServerTest/UnitTest/Setting/MapTable.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using OrmTest.Models;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.UnitTest
|
||||
{
|
||||
public class MapTable : UnitTestBase
|
||||
{
|
||||
public void Init()
|
||||
{
|
||||
//IsAutoCloseConnection
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
var db = GetInstance();
|
||||
var x = db.Queryable<Student>().ToList();
|
||||
}
|
||||
}
|
||||
public SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
|
||||
return db;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user