/// <summary> /// Performs additional business logic and data proxy interaction. /// </summary> /// <remarks> /// <para>This is the third and final method invoked within the execution pipeline of the command returned by <see cref="UpdateCommand"/>, triggered by <see cref="CommandBase.ExecuteAsync"/>.</para> /// <para>Override this method to invoke custom business logic and data proxy interaction.</para> /// <para>This method is only invoked based on the successful validation of all configured validation and business rules.</para> /// </remarks> /// <param name="resource">The resource to update.</param> /// <param name="context">Serves as shared state between all pipeline methods invoked by the command returned by <see cref="UpdateCommand"/>.</param> /// <returns>An awaitable updated representation of the resource resulting from a call to <see cref="Peasy.ISupportUpdate{T}.UpdateAsync"/> of <see cref="DataProxy"/>.</returns> protected virtual async Task <T> OnUpdateCommandValidationSuccessAsync(T resource, ExecutionContext <T> context) { return(await _dataProxy.UpdateAsync(resource)); }
/// <summary> /// Invoked by UpdateCommand() if validation and business rules execute successfully /// </summary> protected virtual async Task <T> UpdateAsync(T entity, ExecutionContext <T> context) { return(await _dataProxy.UpdateAsync(entity)); }