IRelationalDatabaseCreator IRelationalDatabaseCreator Interface

Definition

Performs database/schema creation, and other related operations.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public interface IRelationalDatabaseCreator : IDatabaseCreator
Public Interface IRelationalDatabaseCreator
    Inherits IDatabaseCreator

Methods

Create() Create()

Creates the physical database. Does not attempt to populate it with any schema.

void Create()
Sub Create

CreateAsync(CancellationToken) CreateAsync(CancellationToken)

Asynchronously creates the physical database. Does not attempt to populate it with any schema.

Task CreateAsync(CancellationToken cancellationToken = null)
Function CreateAsync(cancellationToken As CancellationToken = Nothing) As Task
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

A task that represents the asynchronous operation.

CreateTables() CreateTables()

Creates all tables for the current model in the database. No attempt is made to incrementally update the schema. It is assumed that none of the tables exist in the database.

void CreateTables()
Sub CreateTables

CreateTablesAsync(CancellationToken) CreateTablesAsync(CancellationToken)

Asynchronously creates all tables for the current model in the database. No attempt is made to incrementally update the schema. It is assumed that none of the tables exist in the database.

Task CreateTablesAsync(CancellationToken cancellationToken = null)
Function CreateTablesAsync(cancellationToken As CancellationToken = Nothing) As Task
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Delete() Delete()

Deletes the physical database.

void Delete()
Sub Delete

DeleteAsync(CancellationToken) DeleteAsync(CancellationToken)

Asynchronously deletes the physical database.

Task DeleteAsync(CancellationToken cancellationToken = null)
Function DeleteAsync(cancellationToken As CancellationToken = Nothing) As Task
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
System.Threading.Tasks.Task System.Threading.Tasks.Task

A task that represents the asynchronous operation.

EnsureCreated() EnsureCreated()

Ensures that the database for the context exists. If it exists, no action is taken. If it does not exist then the database and all its schema are created. If the database exists, then no effort is made to ensure it is compatible with the model for this context.

(Inherited from IDatabaseCreator)

EnsureCreatedAsync(CancellationToken) EnsureCreatedAsync(CancellationToken)

Asynchronously ensures that the database for the context exists. If it exists, no action is taken. If it does not exist then the database and all its schema are created. If the database exists, then no effort is made to ensure it is compatible with the model for this context.

(Inherited from IDatabaseCreator)

EnsureDeleted() EnsureDeleted()

Ensures that the database for the context does not exist. If it does not exist, no action is taken. If it does exist then the database is deleted.

Warning: The entire database is deleted an no effort is made to remove just the database objects that are used by the model for this context.

(Inherited from IDatabaseCreator)

EnsureDeletedAsync(CancellationToken) EnsureDeletedAsync(CancellationToken)

Asynchronously ensures that the database for the context does not exist. If it does not exist, no action is taken. If it does exist then the database is deleted.

Warning: The entire database is deleted an no effort is made to remove just the database objects that are used by the model for this context.

(Inherited from IDatabaseCreator)

Exists() Exists()

Determines whether the physical database exists. No attempt is made to determine if the database contains the schema for the current model.

bool Exists()
Function Exists As Boolean
Returns
System.Boolean System.Boolean

True if the database exists; otherwise false.

ExistsAsync(CancellationToken) ExistsAsync(CancellationToken)

Asynchronously determines whether the physical database exists. No attempt is made to determine if the database contains the schema for the current model.

Task<bool> ExistsAsync(CancellationToken cancellationToken = null)
Function ExistsAsync(cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
System.Threading.Tasks.Task<System.Boolean> System.Threading.Tasks.Task(Of System.Boolean)

A task that represents the asynchronous operation. The task result contains true if the database exists; otherwise false.