Description
The FormatIdent
method is a static method of the Sandbox.Package
class. It is used to format a package identifier string based on the provided organization, package name, version, and locality. This method is useful for generating a standardized identifier for packages, which can be used for referencing or fetching packages from a repository.
Usage
To use the FormatIdent
method, you need to provide the following parameters:
org
(string): The organization name associated with the package.
package
(string): The name of the package.
version
(int?): The version of the package. This is a nullable integer, so it can be null
if the version is not specified.
local
(bool): A boolean indicating whether the package is local or remote.
The method returns a string
that represents the formatted package identifier.
Example
// Example usage of the FormatIdent method
string org = "myorg";
string package = "mypackage";
int? version = 1;
bool local = true;
string formattedIdent = Sandbox.Package.FormatIdent(org, package, version, local);
// formattedIdent will be something like "myorg/mypackage@1:local"