mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update demo
This commit is contained in:
parent
62cbc406a9
commit
91ecf1e6a6
@ -16,7 +16,7 @@ namespace OrmTest
|
||||
/// Account have permission to create database
|
||||
/// 用有建库权限的数据库账号
|
||||
/// </summary>
|
||||
public static string ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql";
|
||||
public static string ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql;AllowLoadLocalInfile=true";
|
||||
/// <summary>
|
||||
/// Account have permission to create database
|
||||
/// 用有建库权限的数据库账号
|
||||
|
@ -51,21 +51,21 @@ namespace OrmTest
|
||||
db.Insertable(insertObj).With(SqlWith.UpdLock).ExecuteCommand();
|
||||
|
||||
db.Deleteable<Order>().ExecuteCommand();
|
||||
db.Insertable(new Order()
|
||||
{
|
||||
CreateTime = DateTime.Now,
|
||||
CustomId = 11,
|
||||
Name = "11",
|
||||
Price = 11
|
||||
}).UseMySql().ExecuteBulkCopy();
|
||||
db.Insertable(new OrderItem()
|
||||
{
|
||||
CreateTime = DateTime.Now,
|
||||
ItemId = 1,
|
||||
OrderId = 1,
|
||||
OrderName = "a",
|
||||
Price = 11
|
||||
}).UseMySql().ExecuteBulkCopy();
|
||||
//db.Insertable(new Order()
|
||||
//{
|
||||
// CreateTime = DateTime.Now,
|
||||
// CustomId = 11,
|
||||
// Name = "11",
|
||||
// Price = 11
|
||||
//}).UseMySql().ExecuteBulkCopy();
|
||||
//db.Insertable(new OrderItem()
|
||||
//{
|
||||
// CreateTime = DateTime.Now,
|
||||
// ItemId = 1,
|
||||
// OrderId = 1,
|
||||
// OrderName = "a",
|
||||
// Price = 11
|
||||
//}).UseMySql().ExecuteBulkCopy();
|
||||
var data = db.Queryable<Order>().ToList();
|
||||
db.Insertable(data).UseMySql().ExecuteBulkCopy();
|
||||
db.Fastest<Order>().BulkUpdate(data);
|
||||
|
Loading…
Reference in New Issue
Block a user