SqlSugar源码
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.

70 lines
2.2 KiB

6 years ago
using OrmTest.Demo;
using OrmTest.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OrmTest.Demo
{
public class Queue : DemoBase
{
public static void Init()
{
var db = GetInstance();
db.Insertable<Student>(new Student() { Name = "a" }).AddQueue();
db.Insertable<Student>(new Student() { Name = "b" }).AddQueue();
db.SaveQueues();
db.Insertable<Student>(new Student() { Name = "a" }).AddQueue();
db.Insertable<Student>(new Student() { Name = "b" }).AddQueue();
db.Insertable<Student>(new Student() { Name = "c" }).AddQueue();
db.Insertable<Student>(new Student() { Name = "d" }).AddQueue();
var ar = db.SaveQueuesAsync();
ar.Wait();
db.Queryable<Student>().AddQueue();
db.Queryable<School>().AddQueue();
var result = db.SaveQueues<Student, School>();
db.Queryable<Student>().AddQueue();
db.Queryable<School>().AddQueue();
6 years ago
SqlSugar.SugarParameter p = new SqlSugar.SugarParameter("@id",1);
db.AddQueue("select @id", p);
6 years ago
db.AddQueue("select @id ", p);
db.Queryable<Student>().Where(it => it.Id == 1).AddQueue();
db.AddQueue("select (@id) ", p);
6 years ago
var result2 = db.SaveQueues<Student, School, int,int>();
6 years ago
db.AddQueue("select 1");
db.AddQueue("select 2");
db.AddQueue("select 3");
db.AddQueue("select 4");
db.AddQueue("select 5");
db.AddQueue("select 6");
db.AddQueue("select 7");
var result3 = db.SaveQueues<int, int, int, int, int, int, int>();
db.AddQueue("select 1");
var result4 = db.SaveQueues<int >();
db.AddQueue("select 1");
db.AddQueue("select 2");
var result5 = db.SaveQueues<int,int>();
db.AddQueue("select 1");
db.AddQueue("select 2");
db.AddQueue("select 3");
var result6 = db.SaveQueuesAsync<int, int,int>();
result6.Wait();
}
}
}