Model Validation in Web API | ASP.Net Core 5 Web API - Ep 3 | REST API | MVC Model Validation

preview_player
Показать описание
🎁ALL-ACCESS Subscription: Unlock access to all of my courses, both now and in the future at a low $19.99 / month.

💎Learn .NET MAUI while creating a Contacts App in .NET 7:

🔥Learn Blazor while creating an Inventory Management System in .NET 6

💎 Complete Guide to ASP.NET Core Identity

💎Complete Blazor Course: Build an e-commerce app with ASP.NET Blazor and Clean Architecture

💎 Complete Web API Course:

👍Architecture Course

Рекомендации по теме
Комментарии
Автор

Great tutorial! Your teaching is amazing 🤩

rongliao
Автор

thank you for the video !
another way is extending the IValidateObject interface and implenting the validate method on the dto

zawette
Автор

Great Video! However I have another question. How can I validate Model entirely? i.e. If Model have 2 attributes i.e. <code> { "attribute1": "value 1", "attribute2":"value 2" } </code> and if the requests has 3 attributes in its body i.e. <code> { "attribute1": "value 1", "attribute2":"value 2", "evilAttribute":"evil value" } </code>; How can I validate the request to only carry 2 attributes?

HifniNazeer
Автор

I don't like the idea of writing customer validations like that and keep classes for each validation. If you are able to use mediator patter, you can combine it with fluent validation, this way you can keep all the validations in the same class writing elegant validations for you queries and commands

davidmataviejo
Автор

1) White theme
2) Shows references
3) Side bar is not the fat one where you can see the code
4) White theme
5) Solution explorer is 45% of the screen
6) Line numbers are fat and take 10% of screen

Creamagination