public async Task <IActionResult> UploadProfileImage(UserProfilePictueInputModel model) { string userId = this.User.GetUserId(); await this.profileService.UploadProfileImage(userId, model); return(this.Ok()); }
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(); }