/// <summary>
        /// Gets a value indicating whether this loader is able to provide further generic information for a specific plugin
        /// </summary>
        /// <param name="uniqueName">the plugin for which to get the generic information</param>
        /// <returns>a value indicating whether the requested plugin is known by this loader and contains generic arguments</returns>
        public bool HasParamsFor(string uniqueName)
        {
            if (!string.IsNullOrEmpty(genericParamTableName))
            {
                using (database.AcquireConnection(false, out var db))
                {
                    var ct =
                        db.ExecuteCommandScalar <int>($"Select count(a.*) from {tableName} p inner join {genericParamTableName} a on a.PlugInId = p.PlugInId where p.UniqueName = @uniqueName and isnull(disabled,0)=0",
                                                      db.GetParameter("uniqueName", uniqueName));
                    return(ct != 0);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets a Database connection and opens a transaction is requested
 /// </summary>
 /// <param name="useTransaction">indicates whether to open a new transaction on the returned connection</param>
 /// <param name="database">the database connection</param>
 /// <returns>a ResourceLock - Object that enables the caller to free the Database implicitly after using</returns>
 public IResourceLock AcquireDatabase(bool useTransaction, out IDbWrapper database)
 {
     return(connector.AcquireConnection(useTransaction, out database));
 }