public static ParsnipData.Media.Image UploadImage(User uploader, FileUpload uploadControl)
 {
     try
     {
         ParsnipData.Media.Image myImage = new ParsnipData.Media.Image(uploader, uploadControl.PostedFile);
         myImage.Insert();
         return(myImage);
     }
     catch (Exception ex)
     {
         var e = "Exception whilst uploading image: " + ex;
         new LogEntry(Log.Debug)
         {
             Text = e
         };
         Debug.WriteLine(e);
         HttpContext.Current.Response.Redirect("photos?error=video");
     }
     return(null);
 }
 public static void UploadImage(User uploader, FileUpload uploadControl)
 {
     try
     {
         ParsnipData.Media.Image myImage = new ParsnipData.Media.Image(uploader, uploadControl.PostedFile);
         myImage.Insert();
         myImage.Update();
         HttpContext.Current.Response.Redirect($"edit_media?id={myImage.Id}", false);
     }
     catch (Exception ex)
     {
         var e = "Exception whilst uploading image: " + ex;
         new LogEntry(Log.Debug)
         {
             text = e
         };
         Debug.WriteLine(e);
         HttpContext.Current.Response.Redirect("photos?error=video");
     }
 }