Lifetime Constructors

Definition

Initializes a new instance of the Lifetime class.

Overloads

Lifetime(DateTime, DateTime)

Initializes a new instance of the Lifetime class with the specified creation and expiration time.

Lifetime(Nullable<DateTime>, Nullable<DateTime>)

Initializes a new instance of the Lifetime class with the specified creation and expiration time.

Lifetime(DateTime, DateTime)

Initializes a new instance of the Lifetime class with the specified creation and expiration time.

C#
public Lifetime(DateTime created, DateTime expires);

Parameters

created
DateTime

A DateTime that represents the token creation time in UTC.

expires
DateTime

A DateTime that represents the token expiration time in UTC.

Exceptions

The time specified by created occurs before the time specified by expires.

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Lifetime(Nullable<DateTime>, Nullable<DateTime>)

Initializes a new instance of the Lifetime class with the specified creation and expiration time.

C#
public Lifetime(DateTime? created, DateTime? expires);

Parameters

created
Nullable<DateTime>

A DateTime that specifies the token creation time in UTC. Can be null.

expires
Nullable<DateTime>

A DateTime that specifies the token expiration time in UTC. Can be null.

Exceptions

The time specified by created occurs before the time specified by expires.

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1