Beispiel #1
0
        public async Task AbortUpload()
        {
            var fileId = HttpContext.Session.GetInt32("fileId");

            if (fileId.HasValue)
            {
                await resourcesManager.DeleteAsync(fileId.Value);
            }
        }
Beispiel #2
0
        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);
        }