Created
January 18, 2021 14:39
-
-
Save babaktaremi/28f5cd4f1424097a0f0e908aa235dc15 to your computer and use it in GitHub Desktop.
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
namespace MediatRExploration.Application.BookApplication.GetBookById | |
{ | |
public class GetBookByIdRequestHandler:IRequestHandler<GetBookByIdRequest,Book> | |
{ | |
private readonly IBookRepository _bookRepository; | |
public GetBookByIdRequestHandler(IBookRepository bookRepository) | |
{ | |
_bookRepository = bookRepository; | |
} | |
public Task<Book> Handle(GetBookByIdRequest request, CancellationToken cancellationToken) | |
{ | |
return Task.FromResult(_bookRepository.GetBookById(request.BookId)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment