コード例 #1
0
 public ActionResult AddDog(int profileID, [Bind(Include = "HotDogName,LastTimeAte,LastPlaceAte,Rating")] HotDog dog)
 {
     if (!ModelState.IsValid)
     {
         ViewBag.error = "Please check your form and resubmit";
         return(RedirectToAction("CreateDog"));
     }
     try
     {
         profileService.AddDog(new Profile()
         {
             ProfileID = profileID
         }, dog);
         return(RedirectToAction("Details", new { id = profileID }));
     }
     catch
     {
         return(View());
     }
 }