Class RelationalTriggerExtensions
- Namespace
- Microsoft.EntityFrameworkCore
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Trigger extension methods for relational database metadata.
public static class RelationalTriggerExtensions
- Inheritance
-
RelationalTriggerExtensions
- Inherited Members
Remarks
See Database triggers for more information and examples.
Methods
GetDatabaseName(IReadOnlyTrigger)
Gets the name of the trigger in the database.
public static string? GetDatabaseName(this IReadOnlyTrigger trigger)
Parameters
trigger
IReadOnlyTriggerThe trigger.
Returns
- string
The name of the trigger in the database.
GetDatabaseName(IReadOnlyTrigger, in StoreObjectIdentifier)
Gets the database name of the trigger.
public static string? GetDatabaseName(this IReadOnlyTrigger trigger, in StoreObjectIdentifier storeObject)
Parameters
trigger
IReadOnlyTriggerThe trigger.
storeObject
StoreObjectIdentifierThe identifier of the store object.
Returns
- string
The database name of the trigger for the given store object.
GetDatabaseNameConfigurationSource(IConventionTrigger)
Gets the configuration source for the database name.
public static ConfigurationSource? GetDatabaseNameConfigurationSource(this IConventionTrigger trigger)
Parameters
trigger
IConventionTriggerThe trigger.
Returns
- ConfigurationSource?
The configuration source for the database name.
GetDefaultDatabaseName(IReadOnlyTrigger)
Returns the default name that would be used for this trigger in the database.
public static string? GetDefaultDatabaseName(this IReadOnlyTrigger trigger)
Parameters
trigger
IReadOnlyTriggerThe trigger.
Returns
- string
The default name that would be used for this trigger in the database.
GetDefaultDatabaseName(IReadOnlyTrigger, in StoreObjectIdentifier)
Returns the default database name that would be used for this trigger.
public static string? GetDefaultDatabaseName(this IReadOnlyTrigger trigger, in StoreObjectIdentifier storeObject)
Parameters
trigger
IReadOnlyTriggerThe trigger.
storeObject
StoreObjectIdentifierThe identifier of the store object.
Returns
- string
The default name that would be used for this trigger.
GetTableName(IReadOnlyTrigger)
Gets the name of the table on which this trigger is defined.
public static string? GetTableName(this IReadOnlyTrigger trigger)
Parameters
trigger
IReadOnlyTriggerThe trigger.
Returns
- string
The name of the table on which this trigger is defined.
GetTableNameConfigurationSource(IConventionTrigger)
Gets the configuration source for the table name.
public static ConfigurationSource? GetTableNameConfigurationSource(this IConventionTrigger trigger)
Parameters
trigger
IConventionTriggerThe trigger.
Returns
- ConfigurationSource?
The configuration source for the database name.
GetTableSchema(IReadOnlyTrigger)
Gets the schema of the table on which this trigger is defined.
public static string? GetTableSchema(this IReadOnlyTrigger trigger)
Parameters
trigger
IReadOnlyTriggerThe trigger.
Returns
- string
The schema of the table on which this trigger is defined.
GetTableSchemaConfigurationSource(IConventionTrigger)
Gets the configuration source for the table schema.
public static ConfigurationSource? GetTableSchemaConfigurationSource(this IConventionTrigger trigger)
Parameters
trigger
IConventionTriggerThe trigger.
Returns
- ConfigurationSource?
The configuration source for the database name.
SetDatabaseName(IConventionTrigger, string?, bool)
Sets the name of the trigger in the database.
public static string? SetDatabaseName(this IConventionTrigger trigger, string? name, bool fromDataAnnotation = false)
Parameters
trigger
IConventionTriggerThe trigger.
name
stringThe name of the trigger in the database.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetDatabaseName(IMutableTrigger, string?)
Sets the name of the trigger in the database.
public static void SetDatabaseName(this IMutableTrigger trigger, string? name)
Parameters
trigger
IMutableTriggerThe trigger.
name
stringThe name of the trigger in the database.
SetTableName(IConventionTrigger, string?, bool)
Sets the name of the table on which this trigger is defined.
public static string? SetTableName(this IConventionTrigger trigger, string? name, bool fromDataAnnotation = false)
Parameters
trigger
IConventionTriggerThe trigger.
name
stringThe name of the table on which this trigger is defined.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetTableName(IMutableTrigger, string?)
Sets the name of the table on which this trigger is defined.
public static void SetTableName(this IMutableTrigger trigger, string? name)
Parameters
trigger
IMutableTriggerThe trigger.
name
stringThe name of the table on which this trigger is defined.
SetTableSchema(IConventionTrigger, string?, bool)
Sets the schema of the table on which this trigger is defined.
public static string? SetTableSchema(this IConventionTrigger trigger, string? schema, bool fromDataAnnotation = false)
Parameters
trigger
IConventionTriggerThe trigger.
schema
stringThe schema of the table on which this trigger is defined.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetTableSchema(IMutableTrigger, string?)
Sets the schema of the table on which this trigger is defined.
public static void SetTableSchema(this IMutableTrigger trigger, string? schema)
Parameters
trigger
IMutableTriggerThe trigger.
schema
stringThe schema of the table on which this trigger is defined.