aboutsummaryrefslogtreecommitdiff
path: root/API/Database/UserDbRepository.cs
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2020-12-11 10:04:43 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2020-12-11 10:04:43 +0200
commiteb7c817329bcdd9eb520c6760bacf84d6f45f20d (patch)
treefb14e9b824f3b15facf049c0c2e236bec868d4b7 /API/Database/UserDbRepository.cs
parent9b9647e883fa843092b55a086fce8f3c844a13b0 (diff)
downloadDevHive-eb7c817329bcdd9eb520c6760bacf84d6f45f20d.tar
DevHive-eb7c817329bcdd9eb520c6760bacf84d6f45f20d.tar.gz
DevHive-eb7c817329bcdd9eb520c6760bacf84d6f45f20d.zip
Reverted UserDbRepository to use the .Any Linq method
Diffstat (limited to 'API/Database/UserDbRepository.cs')
-rw-r--r--API/Database/UserDbRepository.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/API/Database/UserDbRepository.cs b/API/Database/UserDbRepository.cs
index 7a11621..a51e3a8 100644
--- a/API/Database/UserDbRepository.cs
+++ b/API/Database/UserDbRepository.cs
@@ -17,16 +17,16 @@ namespace API.Database
this._dbRepository = new DbRepository<User>(context);
}
- public async Task<bool> DoesUsernameExist(string username)
+ public bool DoesUsernameExist(string username)
{
- return await this._dbRepository.DbSet
- .SingleAsync(x => x.UserName == username) == null;
+ return this._dbRepository.DbSet
+ .Any(x => x.UserName == username);
}
- public async Task<bool> DoesUserExist(int id)
+ public bool DoesUserExist(int id)
{
- return await this._dbRepository.DbSet
- .SingleAsync(x => x.Id == id) == null;
+ return this._dbRepository.DbSet
+ .Any(x => x.Id == id);
}
}
-} \ No newline at end of file
+}