Created
July 15, 2022 03:40
-
-
Save lexuanquynh/90a882e97dc818f5830a0c67d57edec6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let aDog = Dog(value: ["name": "Lulu", "age": 3]) | |
let anotherDog = Dog(value: ["name": "Nana", "age": 2]) | |
// Instead of using pre-existing dogs... | |
let aPerson = Person(value: [123, "Jane", [aDog, anotherDog]]) | |
// ...we can create them inline | |
let anotherPerson = Person(value: [456, "Jane", [["Buster", 5], ["Buddy", 6]]]) | |
repository.save(entities: [aPerson, anotherPerson], update: true) { result in | |
switch result { | |
case .success: | |
print("Handle success here") | |
case .failure: | |
print("Handle failed here") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment