Box.V2.Managers.BoxFilesManager.GetCommentsAsync C# (CSharp) Method

GetCommentsAsync() public method

Retrieves the comments on a particular file, if any exist.
public GetCommentsAsync ( string id, List fields = null ) : Task>
id string The Id of the item that the comments should be retrieved for.
fields List Attribute(s) to include in the response.
return Task>
        public async Task<BoxCollection<BoxComment>> GetCommentsAsync(string id, List<string> fields = null)
        {
            id.ThrowIfNullOrWhiteSpace("id");

            BoxRequest request = new BoxRequest(_config.FilesEndpointUri, string.Format(Constants.CommentsPathString, id))
                .Param(ParamFields, fields);

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

            return response.ResponseObject;
        }