From eb7c817329bcdd9eb520c6760bacf84d6f45f20d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 11 Dec 2020 10:04:43 +0200 Subject: Reverted UserDbRepository to use the .Any Linq method --- API/Service/UserService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'API/Service/UserService.cs') diff --git a/API/Service/UserService.cs b/API/Service/UserService.cs index 931010e..d32b31f 100644 --- a/API/Service/UserService.cs +++ b/API/Service/UserService.cs @@ -22,7 +22,7 @@ namespace API.Service public async Task CreateUser(UserDTO userDTO) { - if(await this._userDbRepository.DoesUsernameExist(userDTO.UserName)) + if(this._userDbRepository.DoesUsernameExist(userDTO.UserName)) return HttpStatusCode.Forbidden; User user = this._userMapper.Map(userDTO); @@ -41,10 +41,10 @@ namespace API.Service public async Task UpdateUser(int id, UserDTO userDTO) { - if (!await this._userDbRepository.DoesUserExist(id)) + if (!this._userDbRepository.DoesUserExist(id)) return HttpStatusCode.NotFound; - if(await this._userDbRepository.DoesUsernameExist(userDTO.UserName)) + if (this._userDbRepository.DoesUsernameExist(userDTO.UserName)) return HttpStatusCode.Forbidden; User user = this._userMapper.Map(userDTO); @@ -55,7 +55,7 @@ namespace API.Service public async Task DeleteUser(int id) { - if (!await this._userDbRepository.DoesUserExist(id)) + if (!this._userDbRepository.DoesUserExist(id)) return HttpStatusCode.Forbidden; await this._userDbRepository.DeleteAsync(id); -- cgit v1.2.3