BinaryStudio.TaskManager.Web.Controllers.ProfileController.ProfileChanges C# (CSharp) Method

ProfileChanges() private method

private ProfileChanges ( ProfileModel model, System.Web.HttpPostedFileBase image ) : System.Web.Mvc.ActionResult
model BinaryStudio.TaskManager.Web.Models.ProfileModel
image System.Web.HttpPostedFileBase
return System.Web.Mvc.ActionResult
        public ActionResult ProfileChanges(ProfileModel model, HttpPostedFileBase image)
        {
            if (ModelState.IsValid)
            {
                if (image != null)
                {
                    model.ImageMimeType = image.ContentType;
                    model.ImageData = new byte[image.ContentLength];
                    image.InputStream.Read(model.ImageData, 0, image.ContentLength);
                }

                var userId = this.userProcessor.GetUserByName(User.Identity.Name).Id;

                this.userProcessor.UpdateUsersPhoto(userId, model.ImageData, model.ImageMimeType);
            }

            return this.RedirectToAction("Profile");
        }