File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
StructuredMinimalApi/Application/Todos/Commands/CreateTodo Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -6,20 +6,22 @@ namespace StructuredMinimalApi.Application.Todos.Commands.CreateTodo
6
6
/// <summary>
7
7
/// Endpoint to create a todo
8
8
/// </summary>
9
- public class CreateTodoEndpoint : IEndpoint < IResult , CreateTodoCommand >
9
+ public class CreateTodoEndpoint : IEndpoint < IResult , CreateTodoCommand , CancellationToken >
10
10
{
11
11
public void AddRoute ( IEndpointRouteBuilder app )
12
12
{
13
- app . MapPost ( "/Todo" , ( CreateTodoCommand command ) => HandleAsync ( command ) )
13
+ app . MapPost ( "/Todo" , ( CreateTodoCommand command , CancellationToken cancellationToken )
14
+ => HandleAsync ( command , cancellationToken ) )
14
15
. Produces < Message > ( StatusCodes . Status201Created ) ;
15
16
}
16
17
17
18
/// <summary>
18
19
/// Endpoint to create a todo
19
20
/// </summary>
20
21
/// <param name="command"></param>
22
+ /// <param name="cancellationToken"></param>
21
23
/// <returns></returns>
22
- public Task < IResult > HandleAsync ( CreateTodoCommand command )
24
+ public Task < IResult > HandleAsync ( CreateTodoCommand command , CancellationToken cancellationToken )
23
25
{
24
26
var message = new Message
25
27
{
You can’t perform that action at this time.
0 commit comments