I am getting an error using the [Remote] attribute on a [MetadataType] class. I get the following error: Error 15 Attribute 'Remote' is not valid on this declaration type. It is only valid on 'property, indexer' declarations.
I understand what the error is saying, I just don't understand why [Remote] won't work but other attributes work fine.
[MetadataType(typeof(StudentRowMeta))]
public class StudentRow
{
public string Login { get; set; }
}
public class StudentRowMeta
{
[Required(ErrorMessage = "Please Enter Login")]
[StringLength(50, ErrorMessage = "Login can not be more than 50 characters")]
[Remote("IsLoginAvailable", "Validation")]
public object Login;
}