Class DatabaseProviderMetadataExtensions
Extension methods for IDatabaseProviderMetadata.
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Persistence
Assembly: Umbraco.Infrastructure.dll
Syntax
public static class DatabaseProviderMetadataExtensions
Methods
View SourceCanForceCreateDatabase(IEnumerable<IDatabaseProviderMetadata>, String)
Determines whether a database can be created for the specified provider name while ignoring the value of InstallMissingDatabase.
Declaration
public static bool CanForceCreateDatabase(this IEnumerable<IDatabaseProviderMetadata> databaseProviderMetadata, string providerName)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IDatabaseProviderMetadata> | databaseProviderMetadata | The database provider metadata. |
System.String | providerName | The name of the provider. |
Returns
Type | Description |
---|---|
System.Boolean |
|
CanForceCreateDatabase(IEnumerable<IDatabaseProviderMetadata>, IUmbracoDatabaseFactory)
Determines whether a database can be created for the specified provider name while ignoring the value of InstallMissingDatabase.
Declaration
public static bool CanForceCreateDatabase(this IEnumerable<IDatabaseProviderMetadata> databaseProviderMetadata, IUmbracoDatabaseFactory umbracoDatabaseFactory)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IDatabaseProviderMetadata> | databaseProviderMetadata | The database provider metadata. |
IUmbracoDatabaseFactory | umbracoDatabaseFactory | The database factory. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GenerateConnectionString(IDatabaseProviderMetadata, String, String, String, String, Nullable<Boolean>)
Generates the connection string.
Declaration
public static string GenerateConnectionString(this IDatabaseProviderMetadata databaseProviderMetadata, string databaseName = null, string server = null, string login = null, string password = null, bool? integratedAuth = null)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseProviderMetadata | databaseProviderMetadata | The database provider metadata. |
System.String | databaseName | The name of the database, uses the default database name when |
System.String | server | The server. |
System.String | login | The login. |
System.String | password | The password. |
System.Nullable<System.Boolean> | integratedAuth | Indicates whether integrated authentication should be used (when supported by the provider). |
Returns
Type | Description |
---|---|
System.String | The generated connection string. |
GetAvailable(IEnumerable<IDatabaseProviderMetadata>, Boolean)
Gets the available database provider metadata.
Declaration
public static IEnumerable<IDatabaseProviderMetadata> GetAvailable(this IEnumerable<IDatabaseProviderMetadata> databaseProviderMetadata, bool onlyQuickInstall = false)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IDatabaseProviderMetadata> | databaseProviderMetadata | The database provider metadata. |
System.Boolean | onlyQuickInstall | If set to |
Returns
Type | Description |
---|---|
IEnumerable<IDatabaseProviderMetadata> | The available database provider metadata. |