Primitively Primitively
Primitively Primitively
DocFX + Singulink = ♥

Search Results for

    Class UIntAttribute

    This class can be used on a partial record struct to source generate a Primitively IUInt type that encapsulates an uint value.

    Inheritance
    object
    Attribute
    PrimitiveAttribute
    NumericAttribute
    UIntAttribute
    Inherited Members
    PrimitiveAttribute.ImplementIValidatableObject
    Namespace: Primitively
    Assembly: Primitively.Abstractions.dll
    Syntax
    [AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
    public sealed class UIntAttribute : NumericAttribute
    Remarks

    The generated Primitively type will enforce the specified minimum and maximum value constraints.

    Examples

    These examples show how to use the UInt attribute to source generate a Primitively IUInt type.

    [UInt]
    public partial record struct Example;
    
    [UInt(Minimum = 1000000)]
    public partial record struct Example;
    
    [UInt(Minimum = 2000000, Maximum = 4000000)]
    public partial record struct Example;

    Properties

    Maximum

    Gets or sets the maximum value supported by the source generated Primitively IUInt type.

    Declaration
    public uint Maximum { get; set; }
    Property Value
    Type Description
    uint

    The default value is 4,294,967,295. An assigned value should not be less than the Minimum value.

    Minimum

    Gets or sets the minimum value supported by the source generated Primitively IUInt type.

    Declaration
    public uint Minimum { get; set; }
    Property Value
    Type Description
    uint

    The default value is 0. An assigned value should not be greater than the Maximum value.

    © Electronic Hands. All rights reserved.