diff --git a/Sources/ObjectRepresentation.swift b/Sources/ObjectRepresentation.swift index 3eb2f64..863366c 100644 --- a/Sources/ObjectRepresentation.swift +++ b/Sources/ObjectRepresentation.swift @@ -75,6 +75,19 @@ extension CoreStoreObject: ObjectRepresentation {} extension DynamicObject where Self: ObjectRepresentation { + // MARK: Public + + /** + A thread-safe `struct` that is a full-copy of the object's properties + */ + public func asSnapshot() -> ObjectSnapshot? { + + return self.cs_toRaw() + .managedObjectContext + .flatMap({ ObjectSnapshot(objectID: self.cs_id(), context: $0) }) + } + + // MARK: ObjectRepresentation public func objectID() -> Self.ObjectID {