Class Invitation
public record Invitation : IEquatable<Invitation>
- Inheritance
-
Invitation
- Implements
- Inherited Members
Properties
public required string EMail { get; init; }
Property Value
ExpiresAt
When this invitation stops being acceptable, or null to fall back to the configured
Lifetime measured from InviteTime.
public DateTime? ExpiresAt { get; init; }
Property Value
Remarks
Deliberately not required, unlike the three above. Hosts construct an
Invitation themselves — overriding member creation to generate the code and stamp the
time is a supported thing to do — so a required member here would be a compile break for them rather
than a new capability.
Why the expiry lives on the record rather than being derived. A lifetime alone answers "has this expired", but not "give this one another fortnight" — extending would mean rewriting InviteTime, which would falsify when the invitation was created. Holding the expiry separately is what lets an invitation be extended while InviteKey stays the same, so a link that has already been mailed keeps working.
Absent on invitations created before this existed, which is exactly the null case: they fall back to the configured lifetime, and where none is configured they never expire — the behaviour they had.
InviteKey
public required string InviteKey { get; init; }
Property Value
InviteTime
public required DateTime InviteTime { get; init; }