Table of Contents

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 IReadOnlyTrigger

The 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 IReadOnlyTrigger

The trigger.

storeObject StoreObjectIdentifier

The 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 IConventionTrigger

The 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 IReadOnlyTrigger

The 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 IReadOnlyTrigger

The trigger.

storeObject StoreObjectIdentifier

The 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 IReadOnlyTrigger

The 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 IConventionTrigger

The 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 IReadOnlyTrigger

The 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 IConventionTrigger

The 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 IConventionTrigger

The trigger.

name string

The name of the trigger in the database.

fromDataAnnotation bool

Indicates 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 IMutableTrigger

The trigger.

name string

The 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 IConventionTrigger

The trigger.

name string

The name of the table on which this trigger is defined.

fromDataAnnotation bool

Indicates 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 IMutableTrigger

The trigger.

name string

The 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 IConventionTrigger

The trigger.

schema string

The schema of the table on which this trigger is defined.

fromDataAnnotation bool

Indicates 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 IMutableTrigger

The trigger.

schema string

The schema of the table on which this trigger is defined.