ResourceConsumptionAttribute Constructors

Definition

Initializes a new instance of the ResourceConsumptionAttribute class.

Overloads

ResourceConsumptionAttribute(ResourceScope)

This API supports the product infrastructure and is not intended to be used directly from your code.

Initializes a new instance of the ResourceConsumptionAttribute class specifying the scope of the consumed resource.

ResourceConsumptionAttribute(ResourceScope, ResourceScope)

This API supports the product infrastructure and is not intended to be used directly from your code.

Initializes a new instance of the ResourceConsumptionAttribute class specifying the scope of the consumed resource and the scope of how it is consumed.

ResourceConsumptionAttribute(ResourceScope)

Source:
ResourceConsumptionAttribute.cs
Source:
ResourceConsumptionAttribute.cs
Source:
ResourceConsumptionAttribute.cs

Initializes a new instance of the ResourceConsumptionAttribute class specifying the scope of the consumed resource.

This API supports the product infrastructure and is not intended to be used directly from your code.

C#
public ResourceConsumptionAttribute(System.Runtime.Versioning.ResourceScope resourceScope);

Parameters

resourceScope
ResourceScope

The ResourceScope for the consumed resource.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

ResourceConsumptionAttribute(ResourceScope, ResourceScope)

Source:
ResourceConsumptionAttribute.cs
Source:
ResourceConsumptionAttribute.cs
Source:
ResourceConsumptionAttribute.cs

Initializes a new instance of the ResourceConsumptionAttribute class specifying the scope of the consumed resource and the scope of how it is consumed.

This API supports the product infrastructure and is not intended to be used directly from your code.

C#
public ResourceConsumptionAttribute(System.Runtime.Versioning.ResourceScope resourceScope, System.Runtime.Versioning.ResourceScope consumptionScope);

Parameters

resourceScope
ResourceScope

The ResourceScope for the consumed resource.

consumptionScope
ResourceScope

The ResourceScope used by this member.

Remarks

If the ResourceExposureAttribute attribute specifies a scope of None, then the ResourceConsumptionAttribute attribute must specify a resource it consumes and how it consumes it, by specifying a value for the consumptionScope parameter.

The scope specified by consumptionScope should be less than or equal to the scope specified by resourceScope. For example, a Process scope can be consumed as a Process or AppDomain scope, but not as a Machine scope.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1