コード例 #1
0
ファイル: ServiceBase.cs プロジェクト: Sumgon/Peasy.NET
 /// <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="GetByIDCommand"/>, 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="id">The id of the resource to retrieve.</param>
 /// <param name="context">Serves as shared state between all pipeline methods invoked by the command returned by <see cref="GetByIDCommand"/>.</param>
 /// <returns>An awaitable resource returned from <see cref="Peasy.ISupportGetByID{T, TKey}.GetByIDAsync"/> of <see cref="DataProxy"/>.</returns>
 protected virtual async Task <T> OnGetByIDCommandValidationSuccessAsync(TKey id, ExecutionContext <T> context)
 {
     return(await _dataProxy.GetByIDAsync(id));
 }
コード例 #2
0
 /// <summary>
 /// Invoked by GetByIDCommand() if validation and business rules execute successfully
 /// </summary>
 protected virtual async Task <T> GetByIDAsync(TKey id, ExecutionContext <T> context)
 {
     return(await _dataProxy.GetByIDAsync(id));
 }