public async Task <IActionResult> ChangeIcon([FromForm] ChangeProfilePhoto viewModel) { return(await Validation_EmailConfirmation_ModelState(User, ModelState, async (user) => { string extension = await photoManager.SaveProfilePhoto(user.Id, viewModel.File); if (extension != null) { if (userBehaviour.ChangeProfilePhotoPath(user, extension)) { return Ok(); } } return Conflict("Could not save file."); })); }