Skip to content

ConnectionKeyFallbackAttribute class

namespace: Serenity.Data   assemblySerenity.Net.Services

Declares a fallback connection key for a logical connection key. When a connection key is not present in configuration, the fallback connection key is used.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public class ConnectionKeyFallbackAttribute : Attribute

Public Members

name description
ConnectionKeyFallbackAttribute(…) Initializes a new instance of the ConnectionKeyFallbackAttribute class.
ConnectionKey { get; } Gets the logical connection key.
FallbackConnectionKey { get; } Gets the fallback connection key used when ConnectionKey is not configured.

Remarks

This attribute can be applied at the assembly level, e.g. [assembly: ConnectionKeyFallback("ProMeeting", "Default")]. When multiple assemblies declare a fallback for the same connection key, the declaration in the assembly that appears later in the type source (typically the application assembly) wins, so applications can override framework defaults. The attribute is not sealed so that feature-specific derived attributes can be created, e.g. ProSqlFileSystemFallbackAttribute : ConnectionKeyFallbackAttribute.

See Also