static Task SetVoteAsync( Package package, bool up )

robot_2Generated
code_blocksInput

Description

The SetVoteAsync method is an asynchronous extension method for the Sandbox.Package class. It allows you to set a vote on a package, either up or down, based on the boolean parameter provided. This method is part of the SandboxToolExtensions class, which provides various utility functions for working with Sandbox packages and assets.

Usage

To use the SetVoteAsync method, you need to have a reference to a Sandbox.Package object. You can then call this method to set a vote on the package. The method takes two parameters:

  • package: The Sandbox.Package object on which you want to set the vote.
  • up: A bool indicating whether the vote is an upvote (true) or a downvote (false).

This method returns a Task, so it should be awaited in an asynchronous context.

Example

// Example usage of SetVoteAsync
public async Task VoteOnPackage(Sandbox.Package package, bool upvote)
{
    await SandboxToolExtensions.SetVoteAsync(package, upvote);
    // Additional logic after voting
}