public async Task <ActionResult> RemoveFile(string name) { string userName = User.Identity.Name; int storageId = await storageService.GetStorageIdByUserName(userName); await fileService.AddFileToTrash(storageId, name); var shared = await sharedService.GetByName(name, userName); if (shared != null) { await sharedService.Delete(userName, shared.SharedLink); } return(RedirectToAction("Index")); }