private PhotoDTO SavePhotoInformationInDb(Photo information) { try { information.Id = DataService.CreatePhoto(information); return information.ToPhotoDTO(); } catch (Exception e) { string smallPhotoPath = HttpContext.Server.MapPath(information.SmallPhotoUrl); string mediumPhotoPath = HttpContext.Server.MapPath(information.MediumPhotoUrl); string fullPhotoPath = HttpContext.Server.MapPath(information.FullPhotoUrl); System.IO.File.Delete(smallPhotoPath); System.IO.File.Delete(mediumPhotoPath); System.IO.File.Delete(fullPhotoPath); throw new Exception("Save photo failed.", e); } }