Facebook
From Mungo Water Vole, 2 Years ago, written in C#.
This paste is a reply to Re: Re: Untitled from Mature Macaque - view diff
Embed
Download Paste or View Raw
Hits: 186
  1. public class UsersAuthenticateCommandHandler : IRequestHandler<UsersAuthenticateCommand, IActionResult>
  2. {
  3.     private IUserService _userService;
  4.  
  5.     public UsersAuthenticateCommandHandler(IUserService userService)
  6.     {
  7.         _userService = userService;
  8.     }
  9.  
  10.     public async Task<IActionResult> Handle(UsersAuthenticateCommand command, CancellationToken cancellationToken)
  11.     {
  12.         UsersAuthenticateCommandResult response = _userService.Authenticate(command);
  13.  
  14.         if (response == null)
  15.             return new BadRequestObjectResult(new { result = "Username or password is incorrect" });
  16.  
  17.         return new OkObjectResult(response);
  18.     }
  19. }

Replies to Re: Re: Re: Untitled rss

Title Name Language When
Re: Re: Re: Re: Untitled Blush Bushbaby csharp 2 Years ago.