mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
-
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using OrmTest.UnitTest;
|
||||
using OrmTest.Models;
|
||||
using OrmTest.UnitTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -18,7 +19,17 @@ namespace OrmTest
|
||||
|
||||
public void Init()
|
||||
{
|
||||
|
||||
var db = GetInstance();
|
||||
//by entity
|
||||
var s1= db.Deleteable<Student>().Where(new Student() { Id = 1 }).ToSql();
|
||||
//use lock
|
||||
var s2 = db.Deleteable<Student>().With(SqlWith.RowLock).ToSql();
|
||||
//by primary key
|
||||
var s3 = db.Deleteable<Student>().Where(1).ToSql();
|
||||
//by primary key array
|
||||
var s4 = db.Deleteable<Student>().Where(new int[] { 1,2}).ToSql();
|
||||
//by expression
|
||||
var s5 = db.Deleteable<Student>().Where(it=>it.Id==1).ToSql();
|
||||
}
|
||||
|
||||
public SqlSugarClient GetInstance()
|
||||
|
Reference in New Issue
Block a user