Synchronization code

This commit is contained in:
sunkaixuan 2022-10-28 10:47:45 +08:00
parent 7215d2d444
commit 1fbac09f41
8 changed files with 20 additions and 0 deletions

View File

@ -61,6 +61,10 @@ namespace SqlSugar
{
return await ExecuteCommandAsync() > 0;
}
public IDeleteable<T> AsType(Type tableNameType)
{
return AS(this.Context.EntityMaintenance.GetEntityInfo(tableNameType).DbTableName);
}
public IDeleteable<T> AS(string tableName)
{
if (tableName == null) return this;

View File

@ -375,6 +375,10 @@ namespace SqlSugar
result.Inserable = this;
return result;
}
public IInsertable<T> AsType(Type tableNameType)
{
return AS(this.Context.EntityMaintenance.GetEntityInfo(tableNameType).DbTableName);
}
public IInsertable<T> AS(string tableName)
{
if (tableName == null) return this;

View File

@ -196,6 +196,10 @@ namespace SqlSugar
var entityName = typeof(T).Name;
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)
{
if (this.Context.CurrentConnectionConfig.DbType == DbType.SqlServer)

View File

@ -184,6 +184,10 @@ namespace SqlSugar
this.IsVersionValidation = true;
return this;
}
public IUpdateable<T> AsType(Type tableNameType)
{
return AS(this.Context.EntityMaintenance.GetEntityInfo(tableNameType).DbTableName);
}
public IUpdateable<T> AS(string tableName)
{
if (tableName == null) return this;

View File

@ -15,6 +15,7 @@ namespace SqlSugar
Task<int> ExecuteCommandAsync();
Task<bool> ExecuteCommandHasChangeAsync();
IDeleteable<T> AS(string tableName);
IDeleteable<T> AsType(Type tableNameType);
IDeleteable<T> With(string lockString);
IDeleteable<T> Where(T deleteObj);
IDeleteable<T> Where(Expression<Func<T, bool>> expression);

View File

@ -18,6 +18,7 @@ namespace SqlSugar
ISugarQueryable<T> Clone();
ISugarQueryable<T> AS<T2>(string tableName);
ISugarQueryable<T> AS(string tableName);
ISugarQueryable<T> AsType(Type tableNameType);
ISugarQueryable<T> With(string withString);
//ISugarQueryable<T> CrossQueryWithAttr();
ISugarQueryable<T> CrossQuery<Type>(string configId);

View File

@ -21,6 +21,7 @@ namespace SqlSugar
IUpdateable<T> AS(string tableName);
IUpdateable<T> AsType(Type tableNameType);
IUpdateable<T> With(string lockString);

View File

@ -26,6 +26,7 @@ namespace SqlSugar
long ExecuteReturnBigIdentity();
Task<long> ExecuteReturnBigIdentityAsync();
IInsertable<T> AS(string tableName);
IInsertable<T> AsType(Type tableNameType);
IInsertable<T> With(string lockString);
IInsertable<T> InsertColumns(Expression<Func<T, object>> columns);
IInsertable<T> InsertColumns(params string[] columns);