Click or drag to resize

UseEscapedNameAttribute Class

Defines an attribute that will request use of the escaped name of a modeled identifier, i.e., a table or field name. Typically needed when identifier names are reserved SQL key words.
Inheritance Hierarchy
SystemObject
  SystemAttribute
    GSF.Data.ModelUseEscapedNameAttribute

Namespace: GSF.Data.Model
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple = true)]
public sealed class UseEscapedNameAttribute : Attribute
View Source

The UseEscapedNameAttribute type exposes the following members.

Constructors
 NameDescription
Public methodUseEscapedNameAttribute Creates a new UseEscapedNameAttribute that will request use of escaped name for any database.
Public methodUseEscapedNameAttribute(DatabaseType) Creates a new UseEscapedNameAttribute that will request use of escaped name for the specified DatabaseType.
Top
Properties
 NameDescription
Public propertyTargetDatabaseType Gets target DatabaseType for using escaped name.
Public propertyTypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute)
Public propertyUseAnsiQuotes Gets or sets flag that determines if double quotes should be used as the identifier delimiter, per SQL-99 standard, regardless of database type. Defaults to true except for MySQL.
Top
Methods
 NameDescription
Public methodEqualsReturns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute)
Public methodGetHashCodeReturns the hash code for this instance.
(Inherited from Attribute)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute)
Public methodMatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
Applying [UseEscapedName] to a modeled table or field with no parameters will specify that an escaped name be used for all database types. Using a specific database type as a parameter to the attribute, e.g., [UseEscapedName(DatabaseType.SQLServer)], means the escaped name will only be applied to the specific database - however, the attribute allows multiple instances on the same identifier so you could specify that escaping only be applied to two databases, for example: [UseEscapedName(DatabaseType.SQLServer), UseEscapedName(DatabaseType.MySQL)]. In the event multiple attributes have been applied to a modeled identifier where one instance has specified no target database type and others have, the system will assume to target all databases for escaping the name and ignore the specific targets.
See Also