-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
The code works perfectly fine, but something is missing.
What if when I'm tryin to decode a JSON with my NSManagedObject Codable Model, but this object already exist. I mean to say for exemple that I already have in my Database an Object with the same primaryKey. And I don't want to have a duplicate, just update the existing one.
Since I don't really have the control when init(from decoder: Decoder) is called. How can I perform an NSRequest and return the object if it exist or create a new One. Exactly like the Person and its dogs but at the root level ?