We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2005e68 commit be88b42Copy full SHA for be88b42
1 file changed
Sources/CoreDataRepository/UnmanagedModel.swift
@@ -27,4 +27,16 @@ public protocol UnmanagedModel: Equatable {
27
28
/// Initialize of new instance of `Self` from an instance of ``ManagedModel``
29
init(managed: ManagedModel) throws
30
+
31
+ /// ``NSFetchRequest`` for ``ManagedModel`` with a strongly typed ``NSFetchRequest.ResultType``
32
+ static func managedFetchRequest() -> NSFetchRequest<ManagedModel>
33
+}
34
35
+extension UnmanagedModel {
36
+ public static func managedFetchRequest() -> NSFetchRequest<ManagedModel> {
37
+ NSFetchRequest<ManagedModel>(
38
+ entityName: ManagedModel.entity().name ?? ManagedModel.entity()
39
+ .managedObjectClassName
40
+ )
41
+ }
42
}
0 commit comments