diff options
| author | transtrike <transtrike@gmail.com> | 2021-02-03 12:31:32 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2021-02-03 12:31:32 +0200 |
| commit | b417eb391795f157a9db894647730f1daf69a1d3 (patch) | |
| tree | 8a59e5958172839b17e59f0f7cdeaf95ee0492c9 /src/DevHive.Data/Repositories | |
| parent | 8174d2b35c1d3fa90df8b9cb4a75bb3381ea5e39 (diff) | |
| parent | 5d0e9f2c19b68a73baeebf623980d458e3aab80c (diff) | |
| download | DevHive-b417eb391795f157a9db894647730f1daf69a1d3.tar DevHive-b417eb391795f157a9db894647730f1daf69a1d3.tar.gz DevHive-b417eb391795f157a9db894647730f1daf69a1d3.zip | |
Merge branch 'dev' of github.com:Team-Kaleidoscope/DevHive into dev
Diffstat (limited to 'src/DevHive.Data/Repositories')
| -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 |
