Beispiel #1
0
 public ActionResult DeleteProductMedia(string mediaId)
 {
     try
     {
         using (ESamhashoEntities entities = new ESamhashoEntities())
         {
             if (!long.TryParse(mediaId, out long id))
             {
                 return new ActionResult {
                            Message = "Deleted failed"
                 }
             }
             ;
             entities.DeleteProductMedia(id);
             return(new ActionResult {
                 Message = "Deleted successfully", Success = true
             });
         }
     }
     catch (Exception exception)
     {
         Dictionary <string, string> dictionary = new Dictionary <string, string>
         {
             { "mediaId", mediaId }
         };
         ServiceHelper.LogException(exception, dictionary, ErrorSource.Product);
         return(new ActionResult {
             Message = "Error, failed to delete product media, try again."
         });
     }
 }