             switch result {
             case .success(let response):
                 let usersJSON = response.arrayBody
-                self.persistentContainer.sync(usersJSON, inEntityNamed: User.entity().name!) { error in
+                self.dataStack.sync(usersJSON, inEntityNamed: User.entity().name!) { error in
                     completion(.success)
                 }
             case .failure(let response):

import Alamofire

class Fetcher {
    private let persistentContainer: NSPersistentContainer
    private lazy var networking: Networking = {
        Networking(baseURL: "https://jsonplaceholder.typicode.com")
    }()

    init() {
        let modelName = "DataModel"
        self.persistentContainer = NSPersistentContainer(name: modelName)
        let containerURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last!
        let storeURL = containerURL.appendingPathComponent("\(modelName).sqlite")
        try! self.persistentContainer.persistentStoreCoordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: storeURL, options: nil)
    }

    func fetchLocalUsers() -> [User] {
        let request: NSFetchRequest<User> = User.fetchRequest()

        return try! self.persistentContainer.viewContext.fetch(request)
    }

    func syncUsingNetworking(completion: @escaping (_ result: VoidResult) -> ()) {

        guard let data = try? Data(contentsOf: URL(fileURLWithPath: filePath)) else { return }
        guard let json = try! JSONSerialization.jsonObject(with: data, options: []) as? [[String: Any]] else { return }

        self.dataStack.sync(json, inEntityNamed: User.entity().name!) { error in
            completion(.success)
        }
    }
