diff options
Diffstat (limited to 'src/DevHive.Data/Repositories/UserRepository.cs')
| -rw-r--r-- | src/DevHive.Data/Repositories/UserRepository.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/DevHive.Data/Repositories/UserRepository.cs b/src/DevHive.Data/Repositories/UserRepository.cs index 58f8188..ed8db49 100644 --- a/src/DevHive.Data/Repositories/UserRepository.cs +++ b/src/DevHive.Data/Repositories/UserRepository.cs @@ -40,6 +40,7 @@ namespace DevHive.Data.Repositories .Include(x => x.Posts) .Include(x => x.MyFriends) .Include(x => x.FriendsOf) + .Include(x => x.ProfilePicture) .FirstOrDefaultAsync(x => x.Id == id); } @@ -52,6 +53,7 @@ namespace DevHive.Data.Repositories .Include(x => x.Posts) .Include(x => x.MyFriends) .Include(x => x.FriendsOf) + .Include(x => x.ProfilePicture) .FirstOrDefaultAsync(x => x.UserName == username); } #endregion @@ -97,6 +99,14 @@ namespace DevHive.Data.Repositories return await this.SaveChangesAsync(); } + + public async Task<bool> UpdateProfilePicture(Guid userId, string pictureUrl) { + User user = await this.GetByIdAsync(userId); + + user.ProfilePicture.PictureURL = pictureUrl; + + return await this.SaveChangesAsync(); + } #endregion #region Validations |
