public ActionResult Edit(Profile member) { try { MemberProvider memberProvider = new MemberProvider(); AspNetUserImagesProvider _aspNetUserImagesProvider = new AspNetUserImagesProvider(); var userId = User.Identity.GetUserId(); var user = memberProvider.Single(u => u.Id.Equals(userId, StringComparison.OrdinalIgnoreCase)); // TODO: UPDATE IMAGES HERE var images = _aspNetUserImagesProvider.List(i=>i.UserId.Equals(userId,StringComparison.OrdinalIgnoreCase)).ToList(); images.ForEach(i => i.IsInUse = false); _aspNetUserImagesProvider.Update(images.ToArray()); var newProfile = _aspNetUserImagesProvider.Single(i => i.AspNetUserImageId == member.ProfileImageId); newProfile.IsInUse = true; _aspNetUserImagesProvider.Update(newProfile); //END IMAGES HERE return RedirectToAction("Wall"); } catch { return View(); } }