Esempio n. 1
0
 /// <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="InsertCommand"/>, 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 insert.</param>
 /// <param name="context">Serves as shared state between all pipeline methods invoked by the command returned by <see cref="InsertCommand"/>.</param>
 /// <returns>An awaitable updated representation of the resource resulting from a call to <see cref="Peasy.ISupportInsert{T}.InsertAsync"/> of <see cref="DataProxy"/>.</returns>
 protected virtual async Task <T> OnInsertCommandValidationSuccessAsync(T resource, ExecutionContext <T> context)
 {
     return(await _dataProxy.InsertAsync(resource));
 }
Esempio n. 2
0
 /// <summary>
 /// Invoked by InsertCommand() if validation and business rules execute successfully
 /// </summary>
 protected virtual async Task <T> InsertAsync(T entity, ExecutionContext <T> context)
 {
     return(await _dataProxy.InsertAsync(entity));
 }