Ejemplo n.º 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            using (AzureBlobManager azureBlobManager = AzureBlobManager.getInstance())
            {
                SoundDTO sound = soundService.GetSound(id);
                await Task.Run(async() => await azureBlobManager.DeleteAsync(sound.FileNameUrl));

                await soundService.DeleteSoundAsync(sound);
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public async Task <JsonResult> Upload(HttpPostedFileBase blob, string dateStart, string duration)
 {
     using (AzureBlobManager azureBlobManager = AzureBlobManager.getInstance())
     {
         await soundService.MakeSoundAsync(new SoundDTO()
         {
             DateStart = dateStart, Duration = duration, FileNameUrl = await azureBlobManager.SaveAsync(blob).ConfigureAwait(true), UserId = GetId(soundService.GetUsers(), MvcApplication.cookies.Value)
         });
     }
     return(JsonConvert.DeserializeObject <dynamic>("Success: " + blob.FileName));
 }