public ActionResult Create(UserCreationModel creationModel) { if (ModelState.IsValid) { HttpPostedFileBase file = Request.Files["Picture"]; Image img = null; if (file != null && file.ContentLength > 0) { var fileName = Path.GetFileName(file.FileName); var path = "~/Content/Img/" + fileName; file.SaveAs(Server.MapPath(path)); img = new Image(path); } var createdUser = new User(creationModel.Name, creationModel.Birthday) { ImgId = userLogic.AddImg(img) }; userLogic.Create(createdUser); return RedirectToAction("GetList"); } return View(creationModel); }