From 5556ca85f4f4991387817139f220547a5a3a39c2 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 11 Dec 2024 20:51:13 +0000 Subject: [PATCH] Initial commit --- Astral.Services/Interfaces/IUserService.cs | 2 +- Astral.Services/Services/UserService.cs | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Astral.Services/Interfaces/IUserService.cs b/Astral.Services/Interfaces/IUserService.cs index a0f8e5b..7b9958c 100644 --- a/Astral.Services/Interfaces/IUserService.cs +++ b/Astral.Services/Interfaces/IUserService.cs @@ -23,5 +23,5 @@ public interface IUserService /// /// User id. /// Instance of , or null if not found. - Task FindById(string userId); + Task FindById(Guid userId); } diff --git a/Astral.Services/Services/UserService.cs b/Astral.Services/Services/UserService.cs index 5e3ea94..1b1d747 100644 --- a/Astral.Services/Services/UserService.cs +++ b/Astral.Services/Services/UserService.cs @@ -45,7 +45,7 @@ public class UserService : IUserService /// Instance of . /// Instance of . /// Instance of . - /// Instance of . + /// Instance of . /// Instance of . public UserService( IUserRepository userRepository, @@ -154,14 +154,9 @@ public class UserService : IUserService } /// - public async Task FindById(string userId) + public async Task FindById(Guid userId) { - if (!Guid.TryParse(userId, out var userGuid)) - { - return null; - } - - var user = await _userRepository.FindByIdAsync(userGuid); + var user = await _userRepository.FindByIdAsync(userId); return _mapper.Map(user); }