Example #1
0
        public async Task <IActionResult> UploadProfileImage(UserProfilePictueInputModel model)
        {
            string userId = this.User.GetUserId();

            await this.profileService.UploadProfileImage(userId, model);

            return(this.Ok());
        }
Example #2
0
        public async Task UploadProfileImage(string userId, UserProfilePictueInputModel model)
        {
            ApplicationUser user = this.context.Users.Find(userId);

            user.ImageUrl = model.ImageUrl;

            context.Users.Update(user);
            await context.SaveChangesAsync();
        }