book_4_sparkGenerated
code_blocksInput

Description

The Usage property of the Package class provides statistics related to user interactions with the package. This includes data such as the number of times the package has been downloaded, viewed, or interacted with in other ways. This information can be useful for understanding the popularity and engagement level of a package.

Usage

To access the usage statistics of a package, you can use the Usage property. This property returns an instance of PackageUsageStats, which contains detailed information about how users have interacted with the package.

Example

// Assuming 'package' is an instance of Sandbox.Package
var usageStats = package.Usage;

// Accessing specific statistics
int downloads = usageStats.Downloads;
int views = usageStats.Views;

// Displaying the statistics
Console.WriteLine($"Package has been downloaded {downloads} times.");
Console.WriteLine($"Package has been viewed {views} times.");