-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
MovieManagement.API/MovieManagement.API/Controllers/MoviesController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using MediatR; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using MovieManagement.Library.Models; | ||
using MovieManagement.Library.Queries; | ||
|
||
namespace MovieManagement.API.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class MoviesController : ControllerBase | ||
{ | ||
private readonly IMediator _mediator; | ||
|
||
public MoviesController(IMediator mediator) | ||
{ | ||
_mediator = mediator; | ||
} | ||
|
||
// Get: api/<MoviesController> | ||
[HttpGet] | ||
public async Task<List<MovieModel>> Get() | ||
=> await _mediator.Send(new GetMovieListQuery()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters