Пример #1
0
 /// <summary>
 /// Creates a new <see cref="IOperationResult"/> with 400 status code
 /// </summary>
 /// <typeparam name="TCommand">The type of <see cref="ICommand"/> handled by the extended <see cref="ICommandHandler{TCommand}"/></typeparam>
 /// <param name="handler">The extended <see cref="ICommandHandler{TCommand}"/></param>
 /// <returns>A new <see cref="IOperationResult"/></returns>
 public static IOperationResult BadRequest <TCommand>(this ICommandHandler <TCommand> handler)
     where TCommand : ICommand <IOperationResult>
 {
     return(handler.BadRequest(null));
 }
Пример #2
0
 /// <summary>
 /// Creates a new <see cref="IOperationResult"/> with 400 status code
 /// </summary>
 /// <typeparam name="TCommand">The type of <see cref="ICommand"/> handled by the extended <see cref="ICommandHandler{TCommand}"/></typeparam>
 /// <param name="handler">The extended <see cref="ICommandHandler{TCommand}"/></param>
 /// <param name="errorCode">The code of the <see cref="Error"/> contained by the <see cref="IOperationResult"/> to create</param>
 /// <param name="errorMessage">The message of the <see cref="Error"/> contained by the <see cref="IOperationResult"/> to create</param>
 /// <returns>A new <see cref="IOperationResult"/></returns>
 public static IOperationResult BadRequest <TCommand>(this ICommandHandler <TCommand> handler, string errorCode, string errorMessage)
     where TCommand : ICommand <IOperationResult>
 {
     return(handler.BadRequest(new Error(errorCode, errorMessage)));
 }