     @public
     @param {any} id id of the entity to update
     @param {Object} data key-value pair to update
+    @param {ResourceClientInterface} [client=@client]
     @return {Promise<Entity>} updated entity
     ###
-    update: (id, data) ->
-        @client.updateAttributes(id, data).then (obj) =>
+    update: (id, data, client) ->
+        client ?= @client
+        client.updateAttributes(id, data).then (obj) =>
             return @factory.createFromObject(obj)
 
 

    @method delete
    @public
    @param {Entity} entity
    @return {Promise<Boolean>} isDeleted
    ###
    delete: (entity) ->
        @client.destroyById(entity.id).then =>
            return true



    @method singleQuery
    @public
    @param {Object} [params] query parameters
    @param {ResourceClientInterface} [client=@client]
    @return {Promise<Entity>} entity
    ###
    singleQuery: (params, client) ->
        client ?= @client
        client.findOne(params).then (obj) =>
            return @factory.createFromObject(obj)


