Table of Contents

Class KafkaDatabaseCreator

Namespace
MASES.EntityFrameworkCore.KNet.Storage.Internal
Assembly
MASES.EntityFrameworkCore.KNet.dll

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public class KafkaDatabaseCreator : IDatabaseCreator
Inheritance
KafkaDatabaseCreator
Implements
Inherited Members

Remarks

Default initializer

Constructors

KafkaDatabaseCreator(IDatabase)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

public KafkaDatabaseCreator(IDatabase database)

Parameters

database IDatabase

Remarks

Default initializer

Properties

Database

protected virtual IKafkaDatabase Database { get; }

Property Value

IKafkaDatabase

Methods

CanConnect()

Determines whether or not the database is available and can be connected to.

public virtual bool CanConnect()

Returns

bool

true if the database is available; false otherwise.

Remarks

Note that being able to connect to the database does not mean that it is up-to-date with regard to schema creation, etc.

CanConnectAsync(CancellationToken)

Determines whether or not the database is available and can be connected to.

public virtual Task<bool> CanConnectAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

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

Returns

Task<bool>

true if the database is available; false otherwise.

Remarks

Note that being able to connect to the database does not mean that it is up-to-date with regard to schema creation, etc.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.

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.

public virtual bool EnsureCreated()

Returns

bool

true if the database is created, false if it already existed.

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.

public virtual Task<bool> EnsureCreatedAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

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

Returns

Task<bool>

A task that represents the asynchronous save operation. The task result contains true if the database is created, false if it already existed.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.

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.

public virtual bool EnsureDeleted()

Returns

bool

true if the database is deleted, false if it did not exist.

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.

public virtual Task<bool> EnsureDeletedAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

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

Returns

Task<bool>

A task that represents the asynchronous save operation. The task result contains true if the database is deleted, false if it did not exist.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.