Class AdditionalLimitAttribute
- Namespace
- Loehnert.TypeAndResult.Additional
- Assembly
- Loehnert.TypeAndResult.dll
Attribute for an additional limit.
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = true)]
public class AdditionalLimitAttribute : Attribute, _Attribute
- Inheritance
-
AdditionalLimitAttribute
- Implements
- Inherited Members
Constructors
AdditionalLimitAttribute(IDictionary<string, object>)
Initializes a new instance of the AdditionalLimitAttribute class. This constructor is just used for the MEF handling.
public AdditionalLimitAttribute(IDictionary<string, object> metadata)
Parameters
metadata
IDictionary<string, object>All properties of all AdditionalLimitAttributes for the same object.
Remarks
Exceptions
- ArgumentNullException
Thrown when
metadata
is null.- ArgumentException
Thrown when
metadata
contains no object for the key 'ParentType'.- ArgumentException
Thrown when type of value for key 'ParentType' in
metadata
is not of type Type[].
AdditionalLimitAttribute(Type)
Initializes a new instance of the AdditionalLimitAttribute class.
public AdditionalLimitAttribute(Type parentType)
Parameters
parentType
TypeType of the parent where the additional limit belongs to.
Exceptions
- ArgumentNullException
Thrown when
parentType
is null.
Properties
ParentType
Gets the type this additional limit instance belongs to.
public Type ParentType { get; }
Property Value
Remarks
This property is used by the constructor AdditionalLimitAttribute(IDictionary<string, object>) and must be public for MEF meta data export.
ParentTypes
Gets the types this additional limit type belongs to.
public IEnumerable<Type> ParentTypes { get; }