using System;
namespace Esiur.Resource;
///
/// Applies a named Warehouse rate policy to an exported function or property setter.
///
[AttributeUsage(
AttributeTargets.Method | AttributeTargets.Property,
AllowMultiple = false,
Inherited = true)]
public sealed class RateControlAttribute : Attribute
{
///
/// Gets the name used to resolve the policy from the owning Warehouse.
///
public string PolicyName { get; }
public RateControlAttribute(string policyName)
{
if (string.IsNullOrWhiteSpace(policyName))
throw new ArgumentException("A rate policy name is required.", nameof(policyName));
PolicyName = policyName;
}
}