File tree Expand file tree Collapse file tree 7 files changed +16
-52
lines changed
sample/src/NimblePros.SampleToDo.Web/Projects Expand file tree Collapse file tree 7 files changed +16
-52
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,9 @@ namespace NimblePros.SampleToDo.Web.Projects;
8
8
/// <remarks>
9
9
/// Creates a new project given a name.
10
10
/// </remarks>
11
- public class Create : Endpoint < CreateProjectRequest , CreateProjectResponse >
11
+ public class Create ( IMediator mediator ) : Endpoint < CreateProjectRequest , CreateProjectResponse >
12
12
{
13
- private readonly IMediator _mediator ;
14
-
15
- public Create ( IMediator mediator )
16
- {
17
- _mediator = mediator ;
18
- }
13
+ private readonly IMediator _mediator = mediator ;
19
14
20
15
public override void Configure ( )
21
16
{
Original file line number Diff line number Diff line change @@ -5,14 +5,9 @@ namespace NimblePros.SampleToDo.Web.Projects;
5
5
/// <summary>
6
6
/// Deletes a project
7
7
/// </summary>
8
- public class Delete : Endpoint < DeleteProjectRequest >
8
+ public class Delete ( IMediator mediator ) : Endpoint < DeleteProjectRequest >
9
9
{
10
- private readonly IMediator _mediator ;
11
-
12
- public Delete ( IMediator mediator )
13
- {
14
- _mediator = mediator ;
15
- }
10
+ private readonly IMediator _mediator = mediator ;
16
11
17
12
public override void Configure ( )
18
13
{
Original file line number Diff line number Diff line change 4
4
5
5
namespace NimblePros . SampleToDo . Web . Projects ;
6
6
7
- public class GetById : Endpoint < GetProjectByIdRequest , GetProjectByIdResponse >
7
+ public class GetById ( IMediator mediator ) : Endpoint < GetProjectByIdRequest , GetProjectByIdResponse >
8
8
{
9
- private readonly IMediator _mediator ;
10
-
11
- public GetById ( IMediator mediator )
12
- {
13
- _mediator = mediator ;
14
- }
9
+ private readonly IMediator _mediator = mediator ;
15
10
16
11
public override void Configure ( )
17
12
{
Original file line number Diff line number Diff line change @@ -10,14 +10,9 @@ namespace NimblePros.SampleToDo.Web.Projects;
10
10
/// Lists all projects without their sub-properties.
11
11
/// NOTE: In DEV will always show a FAKE ID 1000 project, not real data
12
12
/// </remarks>
13
- public class List : EndpointWithoutRequest < ProjectListResponse >
13
+ public class List ( IMediator mediator ) : EndpointWithoutRequest < ProjectListResponse >
14
14
{
15
- private readonly IMediator _mediator ;
16
-
17
- public List ( IMediator mediator )
18
- {
19
- _mediator = mediator ;
20
- }
15
+ private readonly IMediator _mediator = mediator ;
21
16
22
17
public override void Configure ( )
23
18
{
Original file line number Diff line number Diff line change @@ -10,14 +10,9 @@ namespace NimblePros.SampleToDo.Web.Projects;
10
10
/// Lists all incomplete items in a project.
11
11
/// Returns FAKE data in DEV. Run in production to use real database-driven data.
12
12
/// </remarks>
13
- public class ListIncompleteItems : Endpoint < ListIncompleteItemsRequest , ListIncompleteItemsResponse >
13
+ public class ListIncompleteItems ( IMediator mediator ) : Endpoint < ListIncompleteItemsRequest , ListIncompleteItemsResponse >
14
14
{
15
- private readonly IMediator _mediator ;
16
-
17
- public ListIncompleteItems ( IMediator mediator )
18
- {
19
- _mediator = mediator ;
20
- }
15
+ private readonly IMediator _mediator = mediator ;
21
16
22
17
public override void Configure ( )
23
18
{
Original file line number Diff line number Diff line change 1
- using NimblePros . SampleToDo . Core . ProjectAggregate ;
1
+ using NimblePros . SampleToDo . Core . ProjectAggregate ;
2
2
using NimblePros . SampleToDo . UseCases . Projects . MarkToDoItemComplete ;
3
3
4
4
namespace NimblePros . SampleToDo . Web . ProjectEndpoints ;
5
5
6
6
/// <summary>
7
7
/// Mark an item as complete
8
8
/// </summary>
9
- public class MarkItemComplete : Endpoint < MarkItemCompleteRequest >
9
+ public class MarkItemComplete ( IMediator mediator ) : Endpoint < MarkItemCompleteRequest >
10
10
{
11
- private readonly IMediator _mediator ;
12
-
13
- public MarkItemComplete ( IMediator mediator )
14
- {
15
- _mediator = mediator ;
16
- }
11
+ private readonly IMediator _mediator = mediator ;
17
12
18
13
public override void Configure ( )
19
14
{
Original file line number Diff line number Diff line change 1
- using NimblePros . SampleToDo . UseCases . Projects . Update ;
1
+ using NimblePros . SampleToDo . UseCases . Projects . Update ;
2
2
3
3
namespace NimblePros . SampleToDo . Web . Projects ;
4
4
5
- public class Update : Endpoint < UpdateProjectRequest , UpdateProjectResponse >
5
+ public class Update ( IMediator mediator ) : Endpoint < UpdateProjectRequest , UpdateProjectResponse >
6
6
{
7
- private readonly IMediator _mediator ;
8
-
9
- public Update ( IMediator mediator )
10
- {
11
- _mediator = mediator ;
12
- }
7
+ private readonly IMediator _mediator = mediator ;
13
8
14
9
public override void Configure ( )
15
10
{
16
11
Put ( UpdateProjectRequest . Route ) ;
17
12
AllowAnonymous ( ) ;
18
13
}
19
14
20
-
21
15
public override async Task HandleAsync (
22
16
UpdateProjectRequest request ,
23
17
CancellationToken cancellationToken )
You can’t perform that action at this time.
0 commit comments