CosmosEntityTypeBuilderExtensions.HasDefaultTimeToLive Method

Definition

Overloads

HasDefaultTimeToLive(EntityTypeBuilder, Nullable<Int32>)

Configures the default time to live in seconds at container scope.

HasDefaultTimeToLive(IConventionEntityTypeBuilder, Nullable<Int32>, Boolean)

Configures the default time to live in seconds at container scope.

HasDefaultTimeToLive<TEntity>(EntityTypeBuilder<TEntity>, Nullable<Int32>)

Configures the default time to live in seconds at container scope.

HasDefaultTimeToLive(EntityTypeBuilder, Nullable<Int32>)

Configures the default time to live in seconds at container scope.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder HasDefaultTimeToLive (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder entityTypeBuilder, int? seconds);
static member HasDefaultTimeToLive : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder * Nullable<int> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
<Extension()>
Public Function HasDefaultTimeToLive (entityTypeBuilder As EntityTypeBuilder, seconds As Nullable(Of Integer)) As EntityTypeBuilder

Parameters

entityTypeBuilder
EntityTypeBuilder

The builder for the entity type being configured.

seconds
Nullable<Int32>

The time to live.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

See Modeling entity types and relationships, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Applies to

HasDefaultTimeToLive(IConventionEntityTypeBuilder, Nullable<Int32>, Boolean)

Configures the default time to live in seconds at container scope.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? HasDefaultTimeToLive (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, int? seconds, bool fromDataAnnotation = false);
static member HasDefaultTimeToLive : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * Nullable<int> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
<Extension()>
Public Function HasDefaultTimeToLive (entityTypeBuilder As IConventionEntityTypeBuilder, seconds As Nullable(Of Integer), Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder

Parameters

entityTypeBuilder
IConventionEntityTypeBuilder

The builder for the entity type being configured.

seconds
Nullable<Int32>

The time to live.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Remarks

See Modeling entity types and relationships, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Applies to

HasDefaultTimeToLive<TEntity>(EntityTypeBuilder<TEntity>, Nullable<Int32>)

Configures the default time to live in seconds at container scope.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> HasDefaultTimeToLive<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, int? seconds) where TEntity : class;
static member HasDefaultTimeToLive : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> * Nullable<int> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function HasDefaultTimeToLive(Of TEntity As Class) (entityTypeBuilder As EntityTypeBuilder(Of TEntity), seconds As Nullable(Of Integer)) As EntityTypeBuilder(Of TEntity)

Type Parameters

TEntity

Parameters

entityTypeBuilder
EntityTypeBuilder<TEntity>

The builder for the entity type being configured.

seconds
Nullable<Int32>

The time to live.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

See Modeling entity types and relationships, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Applies to