mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-22 02:51:58 +08:00
Add AsType
This commit is contained in:
@@ -61,6 +61,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return await ExecuteCommandAsync() > 0;
|
return await ExecuteCommandAsync() > 0;
|
||||||
}
|
}
|
||||||
|
public IDeleteable<T> AsType(Type tableNameType)
|
||||||
|
{
|
||||||
|
return AS(this.Context.EntityMaintenance.GetEntityInfo(tableNameType).DbTableName);
|
||||||
|
}
|
||||||
public IDeleteable<T> AS(string tableName)
|
public IDeleteable<T> AS(string tableName)
|
||||||
{
|
{
|
||||||
if (tableName == null) return this;
|
if (tableName == null) return this;
|
||||||
|
|||||||
@@ -375,6 +375,10 @@ namespace SqlSugar
|
|||||||
result.Inserable = this;
|
result.Inserable = this;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public IInsertable<T> AsType(Type tableNameType)
|
||||||
|
{
|
||||||
|
return AS(this.Context.EntityMaintenance.GetEntityInfo(tableNameType).DbTableName);
|
||||||
|
}
|
||||||
public IInsertable<T> AS(string tableName)
|
public IInsertable<T> AS(string tableName)
|
||||||
{
|
{
|
||||||
if (tableName == null) return this;
|
if (tableName == null) return this;
|
||||||
|
|||||||
@@ -196,6 +196,10 @@ namespace SqlSugar
|
|||||||
var entityName = typeof(T).Name;
|
var entityName = typeof(T).Name;
|
||||||
return _As(tableName, entityName);
|
return _As(tableName, entityName);
|
||||||
}
|
}
|
||||||
|
public ISugarQueryable<T> AsType(Type tableNameType)
|
||||||
|
{
|
||||||
|
return AS(this.Context.EntityMaintenance.GetEntityInfo(tableNameType).DbTableName);
|
||||||
|
}
|
||||||
public virtual ISugarQueryable<T> With(string withString)
|
public virtual ISugarQueryable<T> With(string withString)
|
||||||
{
|
{
|
||||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.SqlServer)
|
if (this.Context.CurrentConnectionConfig.DbType == DbType.SqlServer)
|
||||||
|
|||||||
@@ -184,6 +184,10 @@ namespace SqlSugar
|
|||||||
this.IsVersionValidation = true;
|
this.IsVersionValidation = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public IUpdateable<T> AsType(Type tableNameType)
|
||||||
|
{
|
||||||
|
return AS(this.Context.EntityMaintenance.GetEntityInfo(tableNameType).DbTableName);
|
||||||
|
}
|
||||||
public IUpdateable<T> AS(string tableName)
|
public IUpdateable<T> AS(string tableName)
|
||||||
{
|
{
|
||||||
if (tableName == null) return this;
|
if (tableName == null) return this;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace SqlSugar
|
|||||||
Task<int> ExecuteCommandAsync();
|
Task<int> ExecuteCommandAsync();
|
||||||
Task<bool> ExecuteCommandHasChangeAsync();
|
Task<bool> ExecuteCommandHasChangeAsync();
|
||||||
IDeleteable<T> AS(string tableName);
|
IDeleteable<T> AS(string tableName);
|
||||||
|
IDeleteable<T> AsType(Type tableNameType);
|
||||||
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,6 +18,7 @@ namespace SqlSugar
|
|||||||
ISugarQueryable<T> Clone();
|
ISugarQueryable<T> Clone();
|
||||||
ISugarQueryable<T> AS<T2>(string tableName);
|
ISugarQueryable<T> AS<T2>(string tableName);
|
||||||
ISugarQueryable<T> AS(string tableName);
|
ISugarQueryable<T> AS(string tableName);
|
||||||
|
ISugarQueryable<T> AsType(Type tableNameType);
|
||||||
ISugarQueryable<T> With(string withString);
|
ISugarQueryable<T> With(string withString);
|
||||||
//ISugarQueryable<T> CrossQueryWithAttr();
|
//ISugarQueryable<T> CrossQueryWithAttr();
|
||||||
ISugarQueryable<T> CrossQuery<Type>(string configId);
|
ISugarQueryable<T> CrossQuery<Type>(string configId);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace SqlSugar
|
|||||||
|
|
||||||
|
|
||||||
IUpdateable<T> AS(string tableName);
|
IUpdateable<T> AS(string tableName);
|
||||||
|
IUpdateable<T> AsType(Type tableNameType);
|
||||||
IUpdateable<T> With(string lockString);
|
IUpdateable<T> With(string lockString);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace SqlSugar
|
|||||||
long ExecuteReturnBigIdentity();
|
long ExecuteReturnBigIdentity();
|
||||||
Task<long> ExecuteReturnBigIdentityAsync();
|
Task<long> ExecuteReturnBigIdentityAsync();
|
||||||
IInsertable<T> AS(string tableName);
|
IInsertable<T> AS(string tableName);
|
||||||
|
IInsertable<T> AsType(Type tableNameType);
|
||||||
IInsertable<T> With(string lockString);
|
IInsertable<T> With(string lockString);
|
||||||
IInsertable<T> InsertColumns(Expression<Func<T, object>> columns);
|
IInsertable<T> InsertColumns(Expression<Func<T, object>> columns);
|
||||||
IInsertable<T> InsertColumns(params string[] columns);
|
IInsertable<T> InsertColumns(params string[] columns);
|
||||||
|
|||||||
Reference in New Issue
Block a user