      - 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)

        environment?.logger.logDebug(message: String(format: "[%@] Vending new context <%@>.", instanceType(self), context))
        block(context)
    }

    /**
     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
     - returns: array populated with the results of the fetch request
     */
    func fetch<T>(_ request: NSFetchRequest<T>, context: NSManagedObjectContext) -> [T] {
        var results = [T]()
        do {
            results.append(contentsOf: try context.fetch(request))
        } catch {
          let message = String(format: "[%@] Error executing fetch request <%@> on context <%@>.", instanceType(self), request, context)
            environment?.logger.logError(message: message, error: error)
        }
        return results

public extension CoreDataController {

    /**
     Save any outstanding changes to a context, logging any changes and errors. If no context is provided, then all changes to the underlying model are saved via a new vendored context.
     - parameter context: the context to save changes in.
     */
    @available(iOS 10.0, *)
    func save(context: NSManagedObjectContext? = nil) {
        let resolvedContext = context ?? self.context()
        environment?.logger.logDebug(message: String(format: "[%@] About to save changes to context <%@>.", instanceType(self), resolvedContext))
        environment?.logger.logVerbose(message: String(format: "[%@] Changes:\ninserted: %@\ndeleted: %@\nupdated: %@, .", instanceType(self), resolvedContext.insertedObjects, resolvedContext.deletedObjects, resolvedContext.updatedObjects))
        if !resolvedContext.hasChanges {
            environment?.logger.logDebug(message: String(format: "[%@] No unsaved changes in context <%@>.", instanceType(self), resolvedContext))
            return
        }
        
        do {
            try resolvedContext.save()
        } catch {
            let message = String(format: "[%@] Could not save context <%@>.", instanceType(self), resolvedContext)
            environment?.logger.logError(message: message, error: error)
        }
    }
