private AssetApiModel AssetApiModel(ScheduledImage im)
 {
     return(new AssetApiModel()
     {
         FileName = im.FileName,
         Url = im.DownloadUrl
     });
 }
        private ScheduledImage SaveScheduleImageEndity(AssetApiModel assetApiModel)
        {
            var imageMetadata = new ScheduledImage()
            {
                FileName               = assetApiModel.FileName,
                DownloadUrl            = assetApiModel.Url,
                SuccessNotificationUrl = assetApiModel.SuccessNotificationUrl,
                CreatedDate            = DateTime.UtcNow
            };

            _context.ScheduledImages.Add(imageMetadata);

            _context.SaveChanges();
            return(imageMetadata);
        }
        private void ScheduleBackgroundJob(ScheduledImage imageMetadata)
        {
            var helper = new JobsHelper(_context, new DownloadToStream(), new CustomMetadataReader(), _backgroundJobClient, _postNotificationSender);

            _backgroundJobClient.Enqueue(() => helper.DownloadAndReadMetadata(imageMetadata.Id));
        }