public async Task <ActionResult> Create(EmpDetailsClass obj, HttpPostedFileBase profileFile) { CloudBlockBlob profileBlob = null; #region Upload File In Blob Storage //Step 1: Uploaded File in BLob Storage if (profileFile != null && profileFile.ContentLength != 0) { profileBlob = await blobOperations.UploadBlob(profileFile, obj.RowKey); obj.ProfileImage = profileBlob.Uri.ToString(); } //Ends Here #endregion #region Save Information in Table Storage //Step 2: Save the Information in the Table Storage tableOperations.CreateEntity(obj); //Ends Here #endregion return(RedirectToAction("Index")); }
public async Task <ActionResult> Create( EmpDetailsClass obj, HttpPostedFileBase profileFile ) { CloudBlockBlob profileBlob = null; #region Upload File In Blob Storage //Step 1: Uploaded File in BLob Storage if (profileFile != null && profileFile.ContentLength != 0) { profileBlob = await blobOperations.UploadBlob(profileFile); obj.ProfileImage = profileBlob.Uri.ToString(); } //Ends Here #endregion //Que Storeage executio #region Azure web jobs CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["empstorage"]); // Create the queue client CloudQueueClient queueclinet = storageAccount.CreateCloudQueueClient(); // Retrieve a reference to queue CloudQueue queue = queueclinet.GetQueueReference("quwuw"); //Create the Queue if it doesn't already exist. queue.CreateIfNotExists(); CloudQueueMessage message = new CloudQueueMessage(profileBlob.Name); queue.AddMessage(message); #endregion #region Save Information in Table Storage //Step 2: Save the Information in the Table Storage //Get the Original File Size obj.RowKey = obj.EmpId.ToString(); obj.PartitionKey = obj.Email; //Save the File in the Table tableOperations.CreateEntity(obj); //Ends Here #endregion return(RedirectToAction("Index")); }