Ejemplo n.º 1
0
		public ActionResult GetProfile(EditProfileModel model)
		{
			var user = UserManager.FindById(User.Identity.GetUserId());
			user.Name = model.Name;

			byte[] photo = null;
			if (model.Photo != null && model.Photo.ContentLength > 0)
			{
				var stream = new MemoryStream();
				model.Photo.InputStream.CopyTo(stream);
				photo = stream.ToArray();
			}

			if (photo != null)
			{
				user.Photo = photo;
			}

			UserManager.Update(user);

			return RedirectToAction("Index");
		}
Ejemplo n.º 2
0
		public ActionResult GetProfile()
		{
			var user = UserManager.FindById(User.Identity.GetUserId());

			var userModel = new EditProfileModel
			{
				Name = user.Name,
			};

			return View(userModel);
		}