You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.8 KiB
53 lines
1.8 KiB
3 years ago
|
using SqlSugar;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Text;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace OrmTest
|
||
|
{
|
||
|
public class Demo6_Queue
|
||
|
{
|
||
|
public static void Init()
|
||
|
{
|
||
|
Console.WriteLine("");
|
||
|
Console.WriteLine("#### Queue Start ####");
|
||
|
|
||
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||
|
{
|
||
|
DbType = DbType.Oscar,
|
||
|
ConnectionString = Config.ConnectionString,
|
||
|
InitKeyType = InitKeyType.Attribute,
|
||
|
IsAutoCloseConnection = true,
|
||
|
AopEvents = new AopEvents
|
||
|
{
|
||
|
OnLogExecuting = (sql, p) =>
|
||
|
{
|
||
|
Console.WriteLine(sql);
|
||
|
Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value)));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
3 years ago
|
// db.Insertable<Order>(new Order() { Name = "a" }).AddQueue();
|
||
|
// db.Insertable<Order>(new Order() { Name = "b" }).AddQueue();
|
||
|
// db.SaveQueues();
|
||
3 years ago
|
|
||
|
|
||
3 years ago
|
// db.Insertable<Order>(new Order() { Name = "a" }).AddQueue();
|
||
|
// db.Insertable<Order>(new Order() { Name = "b" }).AddQueue();
|
||
|
// db.Insertable<Order>(new Order() { Name = "c" }).AddQueue();
|
||
|
// db.Insertable<Order>(new Order() { Name = "d" }).AddQueue();
|
||
|
// var ar = db.SaveQueuesAsync();
|
||
|
// ar.Wait();
|
||
3 years ago
|
|
||
3 years ago
|
// db.Queryable<Order>().AddQueue();
|
||
|
// db.Queryable<Order>().AddQueue();
|
||
|
// db.AddQueue("select * from order where id=@id", new { id = 10000 });
|
||
|
///* var result2 = db.SaveQueues<Order, Order, Order>()*/;
|
||
3 years ago
|
|
||
|
Console.WriteLine("#### Queue End ####");
|
||
|
}
|
||
|
}
|
||
|
}
|