MODEL VALIDATION in ASP.NET Core | Getting Started With ASP.NET Core Series

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • Hola, Validating user input is an important part of application development. ASP NET Core provides some built-in mechanisms for validating user input.
    In this video let's learn more about how to validate user input for Web API Controllers. This is also applicable to Razor Pages app. I will show you how to use ModelState, data annotation attributes, create custom attributes, and also add class level validations for model classes.
    Additional Watching
    📹Model Binding in ASP NET Core - • MODEL BINDING in ASP.N...
    📹ASP NET Core Series - • ASP.NET Core
    Come say hi! ✋
    🌍 Blog - rahulpnath.com/
    ✉ Subscribe to my Newsletter - www.rahulpnath...
    🐦Twitter - / rahulpnath
    📸Instagram - / rahulpnath
    🎥 Recording Setup and Workflow - www.rahulpnath...
    Make sure to SUBSCRIBE to the channel. THANK YOU for helping me grow this channel !!

Комментарии • 50

  • @MukeshSharma-xd4dn
    @MukeshSharma-xd4dn 2 месяца назад

    You are a sage, a gem 😊

    • @RahulNath
      @RahulNath  Месяц назад

      Glad the videos are helping Mukesh! Hope you are liking the Series bit.ly/asp-net-core-series

  • @niroshanmanoharan4295
    @niroshanmanoharan4295 3 года назад +5

    Another great informative video. We are learning a lot with your help. Thanks a lot Rahul. May God Bless you!

    • @RahulNath
      @RahulNath  3 года назад

      Thanks again Niroshan! Glad you are liking them.

    • @kristianeugene2623
      @kristianeugene2623 3 года назад

      I guess it's kinda off topic but does anybody know a good website to stream newly released series online?

    • @enriquebriggs6009
      @enriquebriggs6009 3 года назад

      @Kristian Eugene flixportal

    • @kristianeugene2623
      @kristianeugene2623 3 года назад

      @Enrique Briggs thanks, I signed up and it seems like a nice service :) Appreciate it !!

    • @enriquebriggs6009
      @enriquebriggs6009 3 года назад

      @Kristian Eugene happy to help =)

  • @DJ_Milky_T
    @DJ_Milky_T 3 года назад +1

    New to .net core - your series has helped a lot many thanks.

    • @RahulNath
      @RahulNath  3 года назад

      Great to hear, Anthony! Do let know in case you need any specific areas covered.

  • @user-ic4rq1jp1o
    @user-ic4rq1jp1o 7 месяцев назад

    Well structured and fully loaded.

  • @jnaras
    @jnaras Год назад

    Very nice. Great explanation.

    • @RahulNath
      @RahulNath  Год назад

      Glad you liked it! Hope you are liking the full series bit.ly/asp-net-core-series

  • @robertmrobo8954
    @robertmrobo8954 Год назад

    I'm enjoying your videos bro... I'm acquring a lot of knowledge this festive season.

  • @malayaprasadlenka9088
    @malayaprasadlenka9088 2 года назад

    Quite informative, have started implementing in my project work 👍

    • @RahulNath
      @RahulNath  2 года назад

      Glad it was helpful! Also check out the full series here bit.ly/asp-net-core-series

  • @priyanshu4016
    @priyanshu4016 3 года назад

    you have our full support . you just go on and create ow-some contents . i am started sharing you channel and videos to my colleagues and friends

    • @RahulNath
      @RahulNath  3 года назад +1

      Thank you for your help and support! Much appreciated and is a great motivation to keep making videos 😀 Do drop in topic suggestions as and when you have any

  • @acp3012
    @acp3012 2 года назад +1

    Fantastic Rahul !!

    • @RahulNath
      @RahulNath  2 года назад

      Thank you! Glad it helped

  • @countingcode4431
    @countingcode4431 Год назад

    I wish if I could have ability to rise count of likes to 1000 personally.❤
    Thanks Rahul, for your efforts and hard work to make our life easy and improving. 😊

    • @RahulNath
      @RahulNath  Год назад +1

      Thank you for your kind words. You've made my day. Hope you are enjoying the full series bit.ly/asp-net-core-series

  • @starman9000
    @starman9000 4 года назад +2

    Hey Rahul, Another great content, next time delete weather controller and create new one :)😄

    • @RahulNath
      @RahulNath  4 года назад +1

      haha, thanks Jay 😃

  • @techrelated2417
    @techrelated2417 2 года назад

    Awesome video 👌 Thank you for making such videos 🙏

    • @RahulNath
      @RahulNath  2 года назад

      Glad you like them! Hope you are enjoying the full series bit.ly/asp-net-core-series

  • @DrunkyDude97
    @DrunkyDude97 Год назад

    So Basically set everything as nullable and use fluentvalidation to validate based on your needs ?
    Is this the way ?
    Also I watched your model binding video,
    It didn't really mention how can we create a custom binder to show our own descriptive messages in case of parsing Erros,
    would love if you clarify on that in text/video.

  • @nirajdahal5019
    @nirajdahal5019 4 года назад +2

    Hello Rahul !! Would it be possible to cover videos on authentication and authorization in .net core web api. Thank you for sharing your content with us :D

    • @RahulNath
      @RahulNath  4 года назад +1

      Hey Niraj, Yes that is coming soon. Needs a lit bit more prep work for it.😃

  • @sovannseung6985
    @sovannseung6985 3 года назад +1

    Really nice video. Thank you so much.

    • @RahulNath
      @RahulNath  3 года назад +1

      Thank you and happy you liked it Sovann.

    • @sovannseung6985
      @sovannseung6985 3 года назад

      Hi@@RahulNath Is it possible if we want to custom return format after we send POST for validate MyData. For example, instead of return
      {
      "type": "",
      "title": "One or more validation errors occurred.",
      "status": 400,
      "traceId": "|cab6akdalekldfdaf",
      "errors": {
      "Age": [
      "The field Age must be between 18 and 32432432"
      ]
      }
      }
      I want something like
      {
      "some_new_field": "...........",
      "title": "Custom message for title. I want to write what ever I want.",
      "status": 400,
      "errors": {
      "Age": [
      "Custom message for Age. I want to write what ever I want."
      ]
      }
      }
      How to achieve this? What code that I could get the return body of validation? Thank you advance.

    • @RahulNath
      @RahulNath  3 года назад +1

      @@sovannseung6985 Does this help stackoverflow.com/questions/54942192/how-to-customize-error-response-in-web-api-with-net-core
      Think it is something similar to what you are looking for?

    • @sovannseung6985
      @sovannseung6985 3 года назад +1

      @@RahulNath Thank you so much Rahul. That exactly what I am looking for. Looking forward to see more video from your chancel about .Net Core. Have a good holiday bro.

    • @RahulNath
      @RahulNath  3 года назад

      @@sovannseung6985 Cool thanks, You too!

  • @mustikit
    @mustikit 2 года назад

    Good job, thanks!

  • @rohitdwivedi8195
    @rohitdwivedi8195 2 года назад

    Great tutorial rahul 👍

  • @acp3012
    @acp3012 2 года назад

    I have a requirement to change database connection based on end point. For example, i have to connect offline SQl serve for gET calls and for POST/PUT i have to connect oltp server. I am thinking we can handle it in Filters... but didn't get clear idea. do you have any videos on Asp.net core Filters?

    • @RahulNath
      @RahulNath  2 года назад

      Yes I do have videos on filter - Do checkout the playlist bit.ly/asp-net-core-series. Hope you were able to resolve the issue.

  • @gangadharkaranapu9062
    @gangadharkaranapu9062 3 года назад

    taking a bow

    • @RahulNath
      @RahulNath  3 года назад

      Thank you Gangadhar🙏

  • @phunsukhwangdu7245
    @phunsukhwangdu7245 3 года назад +1

    Hi Rahun thanks alot for this model validation lecture. Which ide are you using?

    • @RahulNath
      @RahulNath  3 года назад +1

      Glad you like it . I used Jet Brains Rider www.jetbrains.com/rider/

    • @phunsukhwangdu7245
      @phunsukhwangdu7245 3 года назад +1

      @@RahulNath

  • @kumar_codes
    @kumar_codes 4 года назад

    Hey rahul, Explantion is very good. Can you tell us something about Caching(InMemory/Thirdparty) and Bundling and Minification in ASP.NET Core 3.1 bcz official docs are pretty confusing..plz have a look

    • @RahulNath
      @RahulNath  4 года назад +1

      Hey Pritish, Glad you like the videos and thank you for the topic suggestion. Have added it to my list and will try and cover it some time in the coming months.

  • @jai_raje
    @jai_raje 4 года назад

    please explain little bit slowly.

    • @RahulNath
      @RahulNath  4 года назад +2

      Thanks Rajesh for your feedback. This has been one feedback that I got on my earlier videos and thought I had improved on it. I will try and make it a bit slower. Meanwhile, does watching on a slower speed on RUclips help on the existing videos? (support.google.com/youtube/answer/7509567?co=GENIE.Platform%3DDesktop&hl=en)