/// <summary> /// Retrieves data corresponding to the specified Id. /// </summary> public BULK_UPLOAD RetrieveAllData(int imgId) { BulkUploadDBContext db = new BulkUploadDBContext(); BULK_UPLOAD output = db.BULK_UPLOAD.Where(img => img.IMG_ID == imgId).FirstOrDefault(); return(output); }
/// <summary> /// Retrieve One data from Db. /// The element ID can be configurable via config. /// </summary> public BULK_UPLOAD RetrieveFixedData() { int fileId = int.Parse(ConfigurationManager.AppSettings["SingleFile"]); BulkUploadDBContext db = new BulkUploadDBContext(); BULK_UPLOAD output = db.BULK_UPLOAD.Where(img => img.IMG_ID == fileId).FirstOrDefault(); return(output); }
/// <summary> /// Asynchronously save all the images to the disk. /// </summary> private Task <bool> PullMultipleFile(int id) { BULK_UPLOAD imageDetails = _retrieveImage.RetrieveAllData(id); byte[] bytes = imageDetails.IMG; string strBase64 = Convert.ToBase64String(bytes); if (SaveFile(strBase64)) { return(Task.FromResult(true)); } else { return(Task.FromResult(false)); } }