I was rewriting a code snippet from BlazorApp to BlazorApp Core based application. Suddenly now it throws an error on defining RangeAttribute.
Why am I getting the error:
"CS1729 'RangeAttribute' does not contain a constructor that takes 4 arguments TradeNow.Client"
My code is as follows:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace TradeNow.Client.Pages.Adverts.Data
{
public class SellBuy
{
[Required]
[Range(typeof(SellBuyN), nameof(SellBuyN.Sell), typeof(SellBuyN), nameof(SellBuyN.Buy), ErrorMessage = "Select if you are buying or selling")]
public SellBuyN SellBuyN { get; set; }
}
public enum SellBuyN { Sell, Unknown, net, smth, Buy }
}