diff options
Diffstat (limited to 'src/DevHive.Data/Repositories/UserRepository.cs')
| -rw-r--r-- | src/DevHive.Data/Repositories/UserRepository.cs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/DevHive.Data/Repositories/UserRepository.cs b/src/DevHive.Data/Repositories/UserRepository.cs index fe46226..630ad38 100644 --- a/src/DevHive.Data/Repositories/UserRepository.cs +++ b/src/DevHive.Data/Repositories/UserRepository.cs @@ -109,13 +109,9 @@ namespace DevHive.Data.Repositories public async Task<bool> DoesUserHaveThisFriendAsync(Guid userId, Guid friendId) { - User user = await this._context.Users - .AsNoTracking() - .FirstOrDefaultAsync(x => x.Id == userId); + User user = await this.GetByIdAsync(userId); - User friend = await this._context.Users - .AsNoTracking() - .FirstOrDefaultAsync(x => x.Id == friendId); + User friend = await this.GetByIdAsync(friendId); return user.Friends.Contains(friend); } |
