C
C#3mo ago
Denge

.NET Modelstate does not apply validation

Hello, I'm currently developing my first .NET web api/Angular project. I'm nearly done with it, currently developing the test project but I'm facing a problem with this create function. I'm trying to test if it throws an error when i leave the name property out (which is required), but my modelstate does not stop it. (Modelstate remains empty) However, when I test this manually in my front end, the validation does work. I'm using angular as front end. You can check out my code in the screenshots.
No description
No description
No description
No description
1 Reply
Omnissiah
Omnissiah3mo ago
i think validation is done before that point, when deserialization occours
Want results from more Discord servers?
Add your server