From eb13cb7c67c34f08edb9c9b9789e5cf078bb94fb Mon Sep 17 00:00:00 2001 From: berkansasmaz Date: Fri, 24 Dec 2021 17:56:20 +0300 Subject: [PATCH] Update EventAppService.cs --- src/EventHub.Application/Events/EventAppService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EventHub.Application/Events/EventAppService.cs b/src/EventHub.Application/Events/EventAppService.cs index 014c1bb..18811a5 100644 --- a/src/EventHub.Application/Events/EventAppService.cs +++ b/src/EventHub.Application/Events/EventAppService.cs @@ -439,8 +439,8 @@ namespace EventHub.Events { foreach (var userName in speakerUserNames) { - var user = await _userRepository.FindAsync(x => x.UserName == userName.Trim()); - if (user is null) + var user = await _userRepository.AnyAsync(x => x.UserName == userName.Trim()); + if (!user) { throw new BusinessException(EventHubErrorCodes.UserNotFound) .WithData("UserName", userName);