Class NumericReadingAttribute
- Namespace
- Acuit.Pinpoint.IO.Testing.DataAnnotations
- Assembly
- Acuit.Pinpoint.IO.Testing.Abstractions.dll
An attribute that marks a property as a reading that provides a numeric data value.
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public sealed class NumericReadingAttribute : ReadingBaseAttribute, _Attribute
- Inheritance
-
NumericReadingAttribute
- Implements
- Inherited Members
Constructors
NumericReadingAttribute(int)
Initializes a new instance of the NumericReadingAttribute class.
public NumericReadingAttribute(int order = 0)
Parameters
order
intThe relative order of this reading. The default value will be the line number of the property, which will effectively result in readings being ordered in the same order as they are declared in the source code.
Properties
Precision
Gets or sets the precision of data values, as the number of digits after the decimal point, where negative values indicate the number of digits before the decimal point.
public int Precision { get; set; }
Property Value
Methods
GetReadingDescriptor(PropertyInfo)
Gets the reading descriptor for the reading.
public override IAttributedReadingDescriptor GetReadingDescriptor(PropertyInfo propertyInfo)
Parameters
propertyInfo
PropertyInfoThe property to which this attribute is applied.
Returns
Exceptions
- ArgumentNullException
propertyInfo
is null.- InvalidOperationException
propertyInfo
is not compatible with this reading attribute.