Skip to content

Commit f0206a5

Browse files
committed
Add NSPersistentContainer.delete(_:for:)
1 parent c8c816e commit f0206a5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Sources/CoreDataModel/NSPersistentContainer.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ extension NSPersistentContainer: ModelStorage {
5151
}
5252
}
5353

54+
public func delete(_ entity: EntityName, for ids: [ObjectID]) async throws {
55+
try await performBackgroundTask { context in
56+
try context.delete(entity, for: ids)
57+
}
58+
}
59+
5460
public func fetchID(_ fetchRequest: FetchRequest) async throws -> [ObjectID] {
5561
try await performBackgroundTask { context in
5662
try context.fetchID(fetchRequest)

0 commit comments

Comments
 (0)