Primitively Primitively
Primitively Primitively
DocFX + Singulink = ♥

Search Results for

    Class LongAttribute

    This attribute should be used on a partial record struct to source generate a Primitively ILong type that encapsulates a long value.

    Inheritance
    object
    Attribute
    PrimitiveAttribute
    NumericAttribute
    LongAttribute
    Inherited Members
    PrimitiveAttribute.ImplementIValidatableObject
    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.

    © Electronic Hands. All rights reserved.