public async Task AbortUpload() { var fileId = HttpContext.Session.GetInt32("fileId"); if (fileId.HasValue) { await resourcesManager.DeleteAsync(fileId.Value); } }
public async Task <DeleteItemResult> DeleteAsync(DeleteItemModel deleteItemModel) { var authResult = await authenticatorsStore.DeleteItemModelAuthenticator.AuthenticateAsync(deleteItemModel); if (!authResult.Succeed) { return(new DeleteItemResult(authResult)); } var validResult = await validatorsStore.DeleteItemModelValidator.ValidateAsync(deleteItemModel); if (!validResult.Succeed) { return(new DeleteItemResult(validResult)); } var result = new DeleteItemResult(); var itemResource = (await itemsCrudService.GetAsync(deleteItemModel.ItemId)).Resource; await itemsCrudService.DeleteAsync(deleteItemModel.ItemId); await resourcesManager.DeleteAsync(itemResource); return(result); }