The program im writing currently I need to check if the year given by the user is within a certain range. The bottom value is a fixed value, but the top of this range should be capped at the current year and update itself whenever we enter a new year. I have tried using DateTime.Now.Year assigned to an int value for comparison, but range can't compare non static values.

```
[Range(1900, 2022, ErrorMessage = "Property built before 1900.")]

```

Above is the line in question. Any advice?