File

projects/wms-framework/src/lib/dataService/saveOperationResponse.ts

Description

Defines a OperationResponse object that contains the required information to update a saved entity object

Extends

OperationResponse

Index

Properties
Methods

Constructor

constructor(dataServiceContext: DataServiceContext, entity: EntityObject)

Creates an instance of SaveOperationResponse.

Parameters :
Name Type Optional Description
dataServiceContext DataServiceContext No

The {DataServiceContext} object that generated the update operation

entity EntityObject No

the {EntityObject} object that was saved and missing handling pending result

Properties

error
Type : Exception
Default value : null
Inherited from OperationResponse

Methods

Public markAsSuccess
markAsSuccess()

Marks this operation as sucessful which will cause the entity changes to be fully reflected.

Returns : void
Public markInError
markInError(exception: Exception)
Inherited from OperationResponse

Marks this operation as in error

Parameters :
Name Type Optional Description
exception Exception No

the {Exception} object associated to the error

Returns : void
import { EntityObject } from './dataServiceInterfaces';
import { DataServiceContext } from './dataServices';
import { OperationResponse } from './OperationResponse';

/**
 * Defines a {@link OperationResponse} object that contains the required information to update a saved entity object
 *
 * @export
 * @class SaveOperationResponse
 * @extends {OperationResponse}
 */
export class SaveOperationResponse extends OperationResponse {
  /**
   * Creates an instance of SaveOperationResponse.
   * @param {DataServiceContext} dataServiceContext The {DataServiceContext} object that generated the update operation
   * @param {EntityObject} entity the {EntityObject} object that was saved and missing handling pending result
   * @memberof SaveOperationResponse
   */
  constructor(
    private dataServiceContext: DataServiceContext,
    private entity: EntityObject
  ) {
    super();
  }

  /**
   * Marks this operation as sucessful which will cause the entity changes to be fully reflected.
   *
   * @memberof SaveOperationResponse
   */
  public markAsSuccess(): void {
    this.dataServiceContext.saveEntity(this.entity);
  }
}

result-matching ""

    No results matching ""