Dear ASP.NET zero support
If we take the example https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Developing-Step-By-Step-Angular-Creating-New-Person However for the CreatePersonInput class I add a new property
public class CreatePersonInput
{
[Required]
[MaxLength(PersonConsts.MaxNameLength)]
public string Name { get; set; }
[Required]
[MaxLength(PersonConsts.MaxSurnameLength)]
public string Surname { get; set; }
[EmailAddress]
[MaxLength(PersonConsts.MaxEmailAddressLength)]
public string EmailAddress { get; set; }
public bool isCustomer { get; set; }
}
If I pass on string for the isCustomer it will return an error stating the passed on value is incorrect. How can we modify this error message? We attempted multiple solutions and custom validation however as the model binding validation happens before and String != Boolean our custom validation is never triggered.
Kind Regards Kim
1 Answer(s)
-
0
Hi @ISL
You can create a similar action filter like this one https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Mvc/Validation/AbpValidationActionFilter.cs and use it in your app.