This commit is contained in:
sunkaixuan 2017-05-08 00:33:40 +08:00
parent 4c732f25dc
commit be99b5f9c2
3 changed files with 19 additions and 8 deletions

View File

@ -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()

View File

@ -19,11 +19,6 @@ namespace SqlSugar
throw new NotImplementedException();
}
public IDeleteable<T> TableName(string name)
{
throw new NotImplementedException();
}
public IDeleteable<T> Where(List<T> deleteObjs)
{
throw new NotImplementedException();
@ -58,5 +53,10 @@ namespace SqlSugar
{
throw new NotImplementedException();
}
public KeyValuePair<string, List<SugarParameter>> ToSql()
{
throw new NotImplementedException();
}
}
}

View File

@ -10,7 +10,6 @@ namespace SqlSugar
public interface IDeleteable<T>
{
int ExecuteCommand();
IDeleteable<T> TableName(string name);
IDeleteable<T> With(string lockString);
IDeleteable<T> Where(T deleteObj);
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 [] primaryKeyValues);
IDeleteable<T> Where(string whereString,object whereObj);
KeyValuePair<string, List<SugarParameter>> ToSql();
}
}