diff --git a/Sources/VergeTypedIdentifier/EntityType.swift b/Sources/VergeTypedIdentifier/EntityType.swift index 0047dec00d..84f49442c4 100644 --- a/Sources/VergeTypedIdentifier/EntityType.swift +++ b/Sources/VergeTypedIdentifier/EntityType.swift @@ -41,7 +41,7 @@ public struct EntityIdentifier : Hashable, CustomStringConve } /// A protocol describes object is an Entity. -public protocol EntityType: Equatable, Sendable { +public protocol EntityType: Identifiable, Equatable, Sendable { associatedtype EntityIDRawType: Hashable, Sendable @@ -49,3 +49,9 @@ public protocol EntityType: Equatable, Sendable { typealias EntityID = EntityIdentifier } + +extension EntityType { + public var id: EntityID { + entityID + } +}