BB.UI.Web.MVC.Controllers.ManageController.Save C# (CSharp) Метод

Save() приватный Метод

private Save ( long userId, System.Web.HttpPostedFileBase profileImage ) : System.Web.Mvc.ActionResult
userId long
profileImage System.Web.HttpPostedFileBase
Результат System.Web.Mvc.ActionResult
        public ActionResult Save(long userId, HttpPostedFileBase profileImage)
        {
            string imagePath = null;
            if (profileImage != null && profileImage.ContentLength > 0)
            {
                var imageFileName = Path.GetFileName(profileImage.FileName);
                imagePath = FileHelper.NextAvailableFilename(Path.Combine(Server.MapPath(ConfigurationManager.AppSettings["UsersImgPath"]), imageFileName));
                profileImage.SaveAs(imagePath);
                imagePath = Path.GetFileName(imagePath);
            }

            var user = userMgr.ReadUser(userId);

            user.ImageUrl = imagePath;
            userMgr.UpdateUser(user);

            return RedirectToAction("Index", "Home");
        }