2020-12-06 10:46:04 +01:00
|
|
|
// Copyright (c) Umbraco.
|
|
|
|
|
// See LICENSE for more details.
|
2020-03-16 18:51:35 +01:00
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
namespace Umbraco.Cms.Core.Configuration.Models
|
2020-03-16 18:51:35 +01:00
|
|
|
{
|
2020-12-06 10:46:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Typed configuration options for connection strings.
|
|
|
|
|
/// </summary>
|
2021-06-24 08:47:37 +02:00
|
|
|
[UmbracoOptions("ConnectionStrings", BindNonPublicProperties = true)]
|
2020-08-21 14:52:47 +01:00
|
|
|
public class ConnectionStrings
|
2020-03-16 18:51:35 +01:00
|
|
|
{
|
2020-08-24 09:29:40 +02:00
|
|
|
// Backing field for UmbracoConnectionString to load from configuration value with key umbracoDbDSN.
|
|
|
|
|
// Attributes cannot be applied to map from keys that don't match, and have chosen to retain the key name
|
|
|
|
|
// used in configuration for older Umbraco versions.
|
|
|
|
|
// See: https://stackoverflow.com/a/54607296/489433
|
2020-12-06 10:46:04 +01:00
|
|
|
#pragma warning disable SA1300 // Element should begin with upper-case letter
|
|
|
|
|
#pragma warning disable IDE1006 // Naming Styles
|
2020-08-24 09:29:40 +02:00
|
|
|
private string umbracoDbDSN
|
2020-12-06 10:46:04 +01:00
|
|
|
#pragma warning restore IDE1006 // Naming Styles
|
|
|
|
|
#pragma warning restore SA1300 // Element should begin with upper-case letter
|
2020-08-24 09:29:40 +02:00
|
|
|
{
|
2020-09-15 09:11:36 +02:00
|
|
|
get => UmbracoConnectionString?.ConnectionString;
|
|
|
|
|
set => UmbracoConnectionString = new ConfigConnectionString(Constants.System.UmbracoConnectionName, value);
|
2020-03-16 18:51:35 +01:00
|
|
|
}
|
2020-03-23 14:31:21 +01:00
|
|
|
|
2020-12-06 10:46:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value for the Umbraco database connection string..
|
|
|
|
|
/// </summary>
|
2020-09-15 09:11:36 +02:00
|
|
|
public ConfigConnectionString UmbracoConnectionString { get; set; }
|
2020-03-16 18:51:35 +01:00
|
|
|
}
|
|
|
|
|
}
|