|
|
@ -11,42 +11,7 @@ namespace OrmTest |
|
|
|
{ |
|
|
|
public static void Init() |
|
|
|
{ |
|
|
|
Console.WriteLine(""); |
|
|
|
Console.WriteLine("#### Queue Start ####"); |
|
|
|
|
|
|
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() |
|
|
|
{ |
|
|
|
DbType = DbType.Oracle, |
|
|
|
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))); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
db.Insertable<Order>(new Order() { Name = "a" }).AddQueue(); |
|
|
|
db.Insertable<Order>(new Order() { Name = "b" }).AddQueue(); |
|
|
|
db.SaveQueues(); |
|
|
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
|
|
|
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>(); |
|
|
|
|
|
|
|
Console.WriteLine("#### Queue End ####"); |
|
|
|
//NoSupport
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|