Пример #1
0
 public RedirectToActionResult AddCake(Cake cake)
 {
     if (cake == null)
     {
         return(RedirectToAction("AddCake"));
     }
     else
     {
         if (ModelState.IsValid)
         {
             string uniqueFileName = UploadedFile(cake);
             cake.CakePhoto = uniqueFileName;
             _CakeRepository.CreateCake(cake);
         }
     }
     return(RedirectToAction("Index"));
 }