mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Add user case test
This commit is contained in:
parent
9addf374c4
commit
f031d391f0
@ -65,6 +65,7 @@
|
||||
<Compile Include="a8_SelectReturnType.cs" />
|
||||
<Compile Include="UnitTest\Description.cs" />
|
||||
<Compile Include="UserTestCases\Bugs\BugTest.cs" />
|
||||
<Compile Include="UserTestCases\Cases\Unitasdfasdfa1.cs" />
|
||||
<Compile Include="UserTestCases\Config.cs" />
|
||||
<Compile Include="UserTestCases\Cases.cs" />
|
||||
<Compile Include="UserTestCases\Demo\Demo0_SqlSugarClient.cs" />
|
||||
|
@ -10,6 +10,7 @@ namespace OrmTest
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
Unitasdfasdfa1.Init();
|
||||
//Demo
|
||||
Demo0_SqlSugarClient.Init();
|
||||
Demo1_Queryable.Init();
|
||||
|
37
Src/Asp.Net/SqliteTest/UserTestCases/Cases/Unitasdfasdfa1.cs
Normal file
37
Src/Asp.Net/SqliteTest/UserTestCases/Cases/Unitasdfasdfa1.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
internal class Unitasdfasdfa1
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
var db = NewUnitTest.Db;
|
||||
db.CurrentConnectionConfig.MoreSettings = new SqlSugar.ConnMoreSettings()
|
||||
{
|
||||
IsCorrectErrorSqlParameterName=true
|
||||
};
|
||||
db.CodeFirst.InitTables<UnitTERTAFA>();
|
||||
db.Insertable(new UnitTERTAFA()
|
||||
{
|
||||
Name = "a"
|
||||
}).ExecuteCommand();
|
||||
var dt=db.Queryable<UnitTERTAFA>().Take(2) .ToDataTable();
|
||||
dt.Columns.RemoveAt(0);
|
||||
db.Fastest<DataTable>().AS("UnitTERTAFA").BulkCopy(dt);
|
||||
}
|
||||
}
|
||||
public class UnitTERTAFA
|
||||
{
|
||||
[SqlSugar.SugarColumn(ColumnName = "id 1",IsPrimaryKey =true,IsIdentity =true)]
|
||||
public int id { get; set; }
|
||||
[SqlSugar.SugarColumn(ColumnName ="Name 1")]
|
||||
public string Name { get; set; }
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user