Box.V2.Managers.BoxFilesManager.DeleteAsync C# (CSharp) Метод

DeleteAsync() публичный Метод

Discards a file to the trash. The etag of the file can be included as an ‘If-Match’ header to prevent race conditions. Depending on the enterprise settings for this user, the item will either be immediately and permanently deleted from Box or moved to the trash.
public DeleteAsync ( string id, string etag = null ) : Task
id string Id of the file.
etag string This ‘etag’ field of the file, which will be set in the If-Match header.
Результат Task
        public async Task<bool> DeleteAsync(string id, string etag = null)
        {
            id.ThrowIfNullOrWhiteSpace("id");

            BoxRequest request = new BoxRequest(_config.FilesEndpointUri, id)
                .Method(RequestMethod.Delete)
                .Header(Constants.RequestParameters.IfMatch, etag);

            IBoxResponse<BoxFile> response = await ToResponseAsync<BoxFile>(request).ConfigureAwait(false);

            return response.Status == ResponseStatus.Success;
        }