mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 14:04:44 +08:00
-
This commit is contained in:
parent
4c732f25dc
commit
be99b5f9c2
@ -1,4 +1,5 @@
|
|||||||
using OrmTest.UnitTest;
|
using OrmTest.Models;
|
||||||
|
using OrmTest.UnitTest;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -18,7 +19,17 @@ namespace OrmTest
|
|||||||
|
|
||||||
public void Init()
|
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()
|
public SqlSugarClient GetInstance()
|
||||||
|
@ -19,11 +19,6 @@ namespace SqlSugar
|
|||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDeleteable<T> TableName(string name)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IDeleteable<T> Where(List<T> deleteObjs)
|
public IDeleteable<T> Where(List<T> deleteObjs)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
@ -58,5 +53,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public KeyValuePair<string, List<SugarParameter>> ToSql()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ namespace SqlSugar
|
|||||||
public interface IDeleteable<T>
|
public interface IDeleteable<T>
|
||||||
{
|
{
|
||||||
int ExecuteCommand();
|
int ExecuteCommand();
|
||||||
IDeleteable<T> TableName(string name);
|
|
||||||
IDeleteable<T> With(string lockString);
|
IDeleteable<T> With(string lockString);
|
||||||
IDeleteable<T> Where(T deleteObj);
|
IDeleteable<T> Where(T deleteObj);
|
||||||
IDeleteable<T> Where(Expression<Func<T, bool>> expression);
|
IDeleteable<T> Where(Expression<Func<T, bool>> expression);
|
||||||
@ -18,5 +17,6 @@ namespace SqlSugar
|
|||||||
IDeleteable<T> Where<PkType>(PkType primaryKeyValue);
|
IDeleteable<T> Where<PkType>(PkType primaryKeyValue);
|
||||||
IDeleteable<T> Where<PkType>(PkType [] primaryKeyValues);
|
IDeleteable<T> Where<PkType>(PkType [] primaryKeyValues);
|
||||||
IDeleteable<T> Where(string whereString,object whereObj);
|
IDeleteable<T> Where(string whereString,object whereObj);
|
||||||
|
KeyValuePair<string, List<SugarParameter>> ToSql();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user