      - parameters:
      - object: the object to delete
      - context: the context from which to remove the object
-     */
+     */ 
+    @available(iOS 10.0, *)
     func delete(object: NSManagedObject, context: NSManagedObjectContext) {
         environment?.logger.logDebug(message: String(format: "[%@] About to delete object <%@> from context <%@>.", instanceType(self), String(describing: object), context))
         context.delete(object)

public extension CoreDataController {

    /**
     Save any outstanding changes to a context, logging any changes and errors.
     - parameter context: the context to save changes in.
     */
    func save(context: NSManagedObjectContext) {
        environment?.logger.logDebug(message: String(format: "[%@] About to save changes to context <%@>.", instanceType(self), context))
        environment?.logger.logVerbose(message: String(format: "[%@] Changes:\ninserted: %@\ndeleted: %@\nupdated: %@, .", instanceType(self), context.insertedObjects, context.deletedObjects, context.updatedObjects))
        if !context.hasChanges {
            environment?.logger.logDebug(message: String(format: "[%@] No unsaved changes in context <%@>.", instanceType(self), context))
            return
        }

        do {
            try context.save()
        } catch {
            let message = String(format: "[%@] Could not save context <%@>.", instanceType(self), context)
            environment?.logger.logError(message: message, error: error)
        }
    }

        environment?.logger.logDebug(message: String(format: "[%@] Vending new context <%@>.", instanceType(self), context))
        block(context)
    }
    
    @available(iOS 10.0, *)
    func context() -> NSManagedObjectContext {
        return persistentContainer.newBackgroundContext()
    }

    /**
     Returns a typed array of entities fetched, and provides some boilerplate error handling.
     - parameters:
         - request: the fetch request to perform, generic on the type of results
     - context: the context to fetch from. If none is provided, a new context is vendored.
     - returns: array populated with the results of the fetch request
     */
    @available(iOS 10.0, *)
    func fetch<T>(_ request: NSFetchRequest<T>, context: NSManagedObjectContext? = nil) -> [T] {
        var results = [T]()
        let resolvedContext = context ?? self.context()
        do {
            results.append(contentsOf: try resolvedContext.fetch(request))
        } catch {
          let message = String(format: "[%@] Error executing fetch request <%@> on context <%@>.", instanceType(self), request, resolvedContext)
            environment?.logger.logError(message: message, error: error)
        }
        return results
