I am using latest asp.net core with reactjs.net and rendering my react components server side, is it possible for me to pass not just the model, but the model attributes for validation purposes, without having to set up a dependency for a JS validator?
Model
public class LoginViewModel
{
[Required]
[EmailAddress]
[StringLength(50)]
public string Email { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
}
View
@model LoginViewModel
@{
Layout = "~/Views/Shared/_LoginLayout.cshtml";
}
@Html.React("LoginPage", new { loginData = Model })
@Html.ReactInitJavaScript()
And if not, what is the most efficient way to validate models without having to redefine the entire model on the view