Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RangeAttribute.cs
1using System;
2
4{
8 [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
9 public class RangeAttribute : Attribute
10 {
11 private readonly string min;
12 private readonly string max;
13
19 public RangeAttribute(object Min, object Max)
20 {
21 this.min = Min?.ToString();
22 this.max = Max?.ToString();
23 }
24
28 public string Min => this.min;
29
33 public string Max => this.max;
34 }
35}
Defines a valid input range for the property.
string Max
Largest accepted value. Can be null, if no maximum exists.
RangeAttribute(object Min, object Max)
Defines a valid input range for the property.
string Min
Smallest accepted value. Can be null, if no minimum exists.