1

I have a webapi where I want to validate if the used parameter is of type int. I know of the attribute DataTypesAttribute but it doesn't support the simple types. I do not want to create a custom attribute for this.

1 Answers1

1

Take a look at here, as mentioned when you desalinize from a json string to object the value type must be int, if not the desalinization will fail. model validation as it's name suggests is mostly for domain driven and business related validations not type specific.

yekanchi
  • 813
  • 1
  • 12
  • 30