/// <summary> /// 获取数据库表格操作工具 /// </summary> /// <param name="connection">SQL 数据库连接信息</param> /// <param name="attribute">数据库表格配置</param> /// <returns>数据库表格操作工具</returns> /// <param name="isCreateCacheWait">是否等待创建缓存</param> public static ModelTable <modelType> Get(Connection connection, TableAttribute attribute, bool isCreateCacheWait = false) { if (attribute != null)// && Array.IndexOf(ConfigLoader.Config.CheckConnectionNames, attribute.ConnectionType) != -1 { ModelTable <modelType> table = new ModelTable <modelType>(connection, attribute, isCreateCacheWait); if (!table.IsError) { return(table); } } return(null); }
/// <summary> /// 获取数据库表格操作工具 /// </summary> /// <returns>数据库表格操作工具</returns> /// <param name="isCreateCacheWait">是否等待创建缓存</param> public new static ModelTable <modelType> Get(bool isCreateCacheWait = false) { Type type = typeof(modelType); TableAttribute attribute = TypeAttribute.GetAttribute <TableAttribute>(type, false); if (attribute != null)// && Array.IndexOf(ConfigLoader.Config.CheckConnectionNames, attribute.ConnectionType) != -1 { ModelTable <modelType> table = new ModelTable <modelType>(attribute, isCreateCacheWait); if (!table.IsError) { return(table); } } return(null); }