remove(entityClass, primaryKey) {
    validateEntityClass(entityClass)

    let objectStoreName = entityClass.objectStore
    let objectStore = this[PRIVATE.transaction].getObjectStore(objectStoreName)

    return new Promise((resolve, reject) => {
      objectStore.delete(primaryKey).then(resolve).catch(reject)
    }).then(() => {
      let entityManager = this[PRIVATE.entityManager]
      if (entityManager.containsByPrimaryKey(entityClass, primaryKey)) {
        return entityManager.find(entityClass, primaryKey).then((entity) => {
          entityManager.detach(entity)
        })
      }
    })
  }
/**
   * Deletes the specified entity. If the specified entity is present in the
   * persistence context, it will be detached after being deleted.
   *
   * @param {function(new: AbstractEntity, Object<string, *>)} entityClass The
   *        entity class specifying the type of the entity to delete.
   * @param {(number|string|Date|Array)} primaryKey The primary key identifying
   *        the entity to delete.
   * @return {Promise<undefined>} A promise that resolves when the record has
   *         been deleted.
   */
Deletes the specified entity. If the specified entity is present in the
persistence context, it will be detached after being deleted.

@param {function(new: AbstractEntity, Object)} entityClass The
entity class specifying the type of the entity to delete.
@param {(number|string|Date|Array)} primaryKey The primary key identifying
the entity to delete.
@return {Promise} A promise that resolves when the record has
been deleted.
Deletes the specified entity . If the specified entity is present in the persistence context it will be detached after being deleted . @param { function ( new : AbstractEntity Object ) } entityClass The entity class specifying the type of the entity to delete . @param { ( number|string|Date|Array ) } primaryKey The primary key identifying the entity to delete . @return { Promise } A promise that resolves when the record has been deleted .
remove(entityClass, primaryKey) {
    validateEntityClass(entityClass)
    let objectStoreName = entityClass.objectStore
    let objectStore = this[PRIVATE.transaction].getObjectStore(objectStoreName)
    return new Promise((resolve, reject) => {
      objectStore.delete(primaryKey).then(resolve).catch(reject)
    }).then(() => {
      let entityManager = this[PRIVATE.entityManager]
      if (entityManager.containsByPrimaryKey(entityClass, primaryKey)) {
        return entityManager.find(entityClass, primaryKey).then((entity) => {
          entityManager.detach(entity)
        })
      }
    })
  }
remove ( entityClass , primaryKey ) { validateEntityClass ( entityClass ) let objectStoreName = entityClass . objectStore let objectStore = this [ PRIVATE . transaction ] . getObjectStore ( objectStoreName ) return new Promise ( ( resolve , reject ) => { objectStore . delete ( primaryKey ) . then ( resolve ) . catch ( reject ) } ) . then ( ( ) => { let entityManager = this [ PRIVATE . entityManager ] if ( entityManager . containsByPrimaryKey ( entityClass , primaryKey ) ) { return entityManager . find ( entityClass , primaryKey ) . then ( ( entity ) => { entityManager . detach ( entity ) } ) } } ) }
Deletes the specified entity.
Deletes the specified entity .