Website Summary Files Commits Branches @commit @diff @stats
path: root / API / Service / UserService.cs
diff options
context:
space:
mode:
Commiteb7c817329bcdd9eb520c6760bacf84d6f45f20d (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2020-12-11 10:04:43 +0200
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2020-12-11 10:04:43 +0200
Filesfb14e9b824f3b15facf049c0c2e236bec868d4b7 /API/Service/UserService.cs
DevHive-eb7c817329bcdd9eb520c6760bacf84d6f45f20d.tar
DevHive-eb7c817329bcdd9eb520c6760bacf84d6f45f20d.tar.gz
DevHive-eb7c817329bcdd9eb520c6760bacf84d6f45f20d.zip
Parent9b9647e883fa843092b55a086fce8f3c844a13b0 (diff)
Reverted UserDbRepository to use the .Any Linq method
1 files changed, 4 insertions, 4 deletions
-rw-r--r--API/Service/UserService.cs8
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<HttpStatusCode> CreateUser(UserDTO userDTO)
{
- if(await this._userDbRepository.DoesUsernameExist(userDTO.UserName))
+ if(this._userDbRepository.DoesUsernameExist(userDTO.UserName))
return HttpStatusCode.Forbidden;
User user = this._userMapper.Map<User>(userDTO);
@@ -41,10 +41,10 @@ namespace API.Service
public async Task<HttpStatusCode> 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<User>(userDTO);
@@ -55,7 +55,7 @@ namespace API.Service
public async Task<HttpStatusCode> DeleteUser(int id)
{
- if (!await this._userDbRepository.DoesUserExist(id))
+ if (!this._userDbRepository.DoesUserExist(id))
return HttpStatusCode.Forbidden;
await this._userDbRepository.DeleteAsync(id);