mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-26 22:25:49 +08:00
Add itenant api
This commit is contained in:
@@ -24,6 +24,13 @@ namespace SqlSugar
|
||||
SqlSugarScopeProvider GetConnectionScope(dynamic configId);
|
||||
SqlSugarProvider GetConnectionWithAttr<T>();
|
||||
SqlSugarScopeProvider GetConnectionScopeWithAttr<T>();
|
||||
ISugarQueryable<T> QueryableWithAttr<T>();
|
||||
IInsertable<T> InsertableWithAttr<T>(T insertObj) where T : class, new();
|
||||
IInsertable<T> InsertableWithAttr<T>(List<T> insertObjs) where T : class, new();
|
||||
IUpdateable<T> UpdateableWithAttr<T>(T updateObj) where T : class, new();
|
||||
IUpdateable<T> UpdateableWithAttr<T>(List<T> updateObjs) where T : class, new();
|
||||
IDeleteable<T> DeleteableWithAttr<T>(T deleteObjs) where T : class, new();
|
||||
IDeleteable<T> DeleteableWithAttr<T>(List<T> deleteObjs) where T : class, new();
|
||||
bool IsAnyConnection(dynamic configId);
|
||||
|
||||
void Close();
|
||||
|
||||
@@ -1243,5 +1243,36 @@ namespace SqlSugar
|
||||
this.CurrentConnectionConfig = Tenant.ConnectionConfig;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tenant Crud
|
||||
public ISugarQueryable<T> QueryableWithAttr<T>()
|
||||
{
|
||||
return this.GetConnectionWithAttr<T>().Queryable<T>();
|
||||
}
|
||||
public IInsertable<T> InsertableWithAttr<T>(T insertObj) where T : class, new()
|
||||
{
|
||||
return this.GetConnectionWithAttr<T>().Insertable(insertObj);
|
||||
}
|
||||
public IInsertable<T> InsertableWithAttr<T>(List<T> insertObjs) where T : class, new()
|
||||
{
|
||||
return this.GetConnectionWithAttr<T>().Insertable(insertObjs);
|
||||
}
|
||||
public IUpdateable<T> UpdateableWithAttr<T>(T updateObj) where T : class, new()
|
||||
{
|
||||
return this.GetConnectionWithAttr<T>().Updateable(updateObj);
|
||||
}
|
||||
public IUpdateable<T> UpdateableWithAttr<T>(List<T> updateObjs) where T : class, new()
|
||||
{
|
||||
return this.GetConnectionWithAttr<T>().Updateable(updateObjs);
|
||||
}
|
||||
public IDeleteable<T> DeleteableWithAttr<T>(T deleteObject) where T : class, new()
|
||||
{
|
||||
return this.GetConnectionWithAttr<T>().Deleteable(deleteObject);
|
||||
}
|
||||
public IDeleteable<T> DeleteableWithAttr<T>(List<T> deleteObjects) where T : class, new()
|
||||
{
|
||||
return this.GetConnectionWithAttr<T>().Deleteable(deleteObjects);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,5 +695,33 @@ namespace SqlSugar
|
||||
{
|
||||
return ScopedContext.ThenMapperAsync(list, action);
|
||||
}
|
||||
public ISugarQueryable<T> QueryableWithAttr<T>()
|
||||
{
|
||||
return ScopedContext.QueryableWithAttr<T>();
|
||||
}
|
||||
public IInsertable<T> InsertableWithAttr<T>(T insertObj) where T : class, new()
|
||||
{
|
||||
return ScopedContext.InsertableWithAttr<T>(insertObj);
|
||||
}
|
||||
public IInsertable<T> InsertableWithAttr<T>(List<T> insertObjs) where T : class, new()
|
||||
{
|
||||
return ScopedContext.InsertableWithAttr<T>(insertObjs);
|
||||
}
|
||||
public IUpdateable<T> UpdateableWithAttr<T>(T updateObj) where T : class, new()
|
||||
{
|
||||
return ScopedContext.UpdateableWithAttr<T>(updateObj);
|
||||
}
|
||||
public IUpdateable<T> UpdateableWithAttr<T>(List<T> updateObjs) where T : class, new()
|
||||
{
|
||||
return ScopedContext.UpdateableWithAttr<T>(updateObjs);
|
||||
}
|
||||
public IDeleteable<T> DeleteableWithAttr<T>(T deleteObj) where T : class, new()
|
||||
{
|
||||
return ScopedContext.DeleteableWithAttr<T>(deleteObj);
|
||||
}
|
||||
public IDeleteable<T> DeleteableWithAttr<T>(List<T> deleteObjs) where T : class, new()
|
||||
{
|
||||
return ScopedContext.DeleteableWithAttr<T>(deleteObjs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user