Class LongAttribute
This attribute should be used on a partial record struct
to source generate
a Primitively ILong type that encapsulates a long value.
Inherited Members
Namespace: Primitively
Assembly: Primitively.Abstractions.dll
Syntax
[AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
public sealed class LongAttribute : NumericAttribute
Remarks
The generated Primitively type will enforce the specified minimum and maximum value constraints.
Examples
These examples show how to use the Long attribute to source generate a Primitively ILong type.
[Long]
public partial record struct Example;
[Long(Minimum = 0)]
public partial record struct Example;
[Long(Minimum = 1000, Maximum = 2000)]
public partial record struct Example;
Properties
Maximum
Gets or sets the maximum value supported by the source generated Primitively ILong type.
Declaration
public long Maximum { get; set; }
Property Value
Type | Description |
---|---|
long | The default value is 9,223,372,036,854,775,807. An assigned value should not be less than the Minimum value. |
Minimum
Gets or sets the minimum value supported by the source generated Primitively ILong type.
Declaration
public long Minimum { get; set; }
Property Value
Type | Description |
---|---|
long | The default value is -9,223,372,036,854,775,807. An assigned value should not be greater than the Maximum value. |