public ActionResult AddPhoto(int id, HttpPostedFileBase photo)
{
if (photo != null && photo.ContentLength>0)
{
var pathToPhoto = Path.Combine(Server.MapPath("~/Content/photos"), id.ToString() + Path.GetExtension(photo.FileName));
photo.SaveAs(pathToPhoto);
var client = repository.Get<Person>(id);
client.PhotoUri = "~/Content/photos/" + Path.GetFileName(pathToPhoto);
repository.Save(client);
}
return RedirectToAction("Edit", new {id});
}