Poorna Soysa
Poorna Soysa
  • 15
  • 8 710
The Options Pattern Validation with Data Annotations in .NET 9 | ASP.NET Core Tutorial
In this ASP.NET Core tutorial, you'll learn how to implement Options Pattern Validation using Data Annotations in .NET 9. The Options Pattern allows for strongly typed configuration binding, but ensuring that these configurations are valid is crucial to avoid errors at runtime. In this video, we’ll walk through how to add validation to your IOptions using Data Annotations and ValidateOnStart, ensuring your application settings are correct right from the start.
📚 Learn More:
➤ Master the Options Pattern in .NET 9 with Dependency Injection | ASP.NET Core Tutorial - ua-cam.com/video/IGnTWoX4YLY/v-deo.html
➤ .NET 9 - Implementing Repository Pattern with Minimal API & SQLite | Entity Framework Core Tutorial: ua-cam.com/video/bOJLgzU4M74/v-deo.html
➤ .NET 9 - Generic Repository Pattern with Minimal API in ASP.NET Core | Entity Framework Core: ua-cam.com/video/EvD8BU9HHWc/v-deo.html
Connect with me 👋:
► GITHUB: www.github.com/poorna-soysa
► LINKEDIN: www.linkedin.com/in/poorna-soysa/
► TWITTER: TechPoorna/
👉 Support my work:
www.buymeacoffee.com/poorna.soysa
Don't Forget to:
👍 Like this video if you found it helpful
🔔 Subscribe for more coding tutorials
💬 Comment if you have any questions or suggestions
Chapters:
0:00 Intro
0:40 Recap
2:10 Adding Validation with Data Annotations
2:30 Configuring Options Pattern for Validation
3:30 Implementing ValidateOnStart()
4:20 Adding Custom Validation in Validate(
#dotnet #optionspattern #aspnetcore #webapi #dotnetcore #dotnet9 #minimalapi #csharp #csharptutorial #aspnetcore #validation #optionspatternvalidation
Переглядів: 5

Відео

Master the Options Pattern in .NET 9 with Dependency Injection | ASP.NET Core Tutorial
Переглядів 44220 годин тому
Unlock the full potential of configuration management in your .NET 9 and ASP.NET Core applications with the Options Pattern! In this video, I'll guide you through everything you need to know about implementing the Options Pattern, from setting up appSettings.json to creating strongly-typed configuration classes and leveraging dependency injection for clean, scalable code. 📚 Learn More: ➤ .NET 9...
.NET 9 - Generic Repository Pattern with Minimal API in ASP.NET Core | Entity Framework Core
Переглядів 1,3 тис.День тому
🚀 𝗚𝗲𝗻𝗲𝗿𝗶𝗰 𝗥𝗲𝗽𝗼𝘀𝗶𝘁𝗼𝗿𝘆 𝗣𝗮𝘁𝘁𝗲𝗿𝗻 𝗶𝗻 .𝗡𝗘𝗧 𝟵 𝘄𝗶𝘁𝗵 𝗠𝗶𝗻𝗶𝗺𝗮𝗹 𝗔𝗣𝗜 Learn how to implement the Generic Repository Pattern using Minimal API in ASP.NET Core. This tutorial demonstrates building clean, reusable code and managing database operations efficiently with Entity Framework Core(EF Core). 🛠️ Technologies and Tools: 🔹.NET 9 🔹ASP.NET Core Minimal API 🔹Entity Framework Core (EF Core) 🔹SQLite 🔹Postman 📚 ...
.NET 9 - Implementing Repository Pattern with Minimal API & SQLite | Entity Framework Core Tutorial
Переглядів 2,7 тис.14 днів тому
In this video, we're tackling the Repository Pattern in .NET 9 with a Minimal API and Entity Framework Core, all powered by a SQLite database. What You'll Learn: 🔹What is the Repository Pattern and why it's important 🔹Setting up a Minimal API in .NET 9 🔹Using Entity Framework Core (EF Core) with SQLite 🔹Implementing the Repository Pattern for clean and maintainable code 🔹Step-by-step coding wal...
Build a REST API From Scratch in .NET 8 and EF Core | Beginners Tutorial
Переглядів 1,1 тис.21 день тому
Learn how to build a REST API in .NET 8 from scratch in this step-by-step tutorial! Perfect for beginners, this video covers creating a Todo app with full CRUD functionality (Create, Read, Update, Delete) using .NET 8 and Entity Framework Core. You'll set up a project, define models, configure a database, and implement API endpoints. Whether you're new to .NET or looking to polish your API deve...

КОМЕНТАРІ

  • @UmutDereWork
    @UmutDereWork 17 годин тому

    Great demonstration, thanks for effort. What would be a good use case scenario for the IOptionsSnapshot and IOptionsMonitor interfaces?

  • @SinaSoltani-tf8zo
    @SinaSoltani-tf8zo 19 годин тому

    This pattern has been spread like a virus between inexperienced developer who actually doesn't have an overview on the whole concept of development 🙄🙄🙄 Bro, there is no need to use a Repository pattern when you're working with Entity Framework. DbContext is a UnitOfWork, and DbSet is a Repository. Your Repository is doing absolutely nothing. It's just a Wrapper that repeate/uses the exact methods of Entity Framework. It also makes your Testing worst, because many developers go and Mock the Repository, which means many problems that happen on database relations will never be noticed.

  • @buck1998
    @buck1998 3 дні тому

    Hey Pooran, i recently encountered a problem in .net core where i need to perform a put operation on a main model and CRUD on its sub model, I was not able to achieve this at a same time as this was making a conflict between the entity tracking system, finally i added the ignore in the mapping, Do have more accurate way to achieve that thing? I will really appreciate your effort 😊😊

  • @Luisllaboj19
    @Luisllaboj19 8 днів тому

    Great demo! Would you add an extra layer between Repositories and Endpoints? Maybe a Services layer that maps from and to DTOs: Endpoints/ < --- DTOs --- > Services/ < --- Entities --- > Repositories/

    • @PoornaSoysaTech
      @PoornaSoysaTech 7 днів тому

      Yes, I will implement the DTOs in the next video and show how the mapping logic works.

    • @Luisllaboj19
      @Luisllaboj19 7 днів тому

      @@PoornaSoysaTech Great! Thank you

  • @balazs.hideghety
    @balazs.hideghety 8 днів тому

    The repository can work this way with aggregates, but when using ORM entities, you can accidentally save other entities as well. Save should be on the UoW - once that is fixed, we'd talk about whether these interfaces and generic impl. do make sense (in some more complex scenarios, yes, but not for CRUD)...

    • @PoornaSoysaTech
      @PoornaSoysaTech 7 днів тому

      Valid point! In my upcoming videos, I'll be covering how to implement the UoW pattern. This is part of a video series where I'm building and explaining things step by step. Thanks.

  • @manuelleone1805
    @manuelleone1805 8 днів тому

    Nice!

  • @eltonbrito877
    @eltonbrito877 9 днів тому

    👏🏽👏🏽👏🏽

  • @PoornaSoysaTech
    @PoornaSoysaTech 10 днів тому

    WATCH NEXT VIDEO: Implementing Repository Pattern with Minimal API & SQLite | Entity Framework Core ua-cam.com/video/bOJLgzU4M74/v-deo.html

  • @kelvin8548
    @kelvin8548 10 днів тому

    Incredible content, congratulations.

  • @Luisllaboj19
    @Luisllaboj19 12 днів тому

    Would you maybe use Services to separate the logic from the Controller? If so, I’ve always been curious as of what work will be left for the controller to handle, I’ve never really grasped on those concepts and the separation of concerns between a controller and a service

    • @PoornaSoysaTech
      @PoornaSoysaTech 10 днів тому

      Yes, services are used to separate business logic from controllers, keeping controllers lightweight.

  • @iUmerFarooq
    @iUmerFarooq 14 днів тому

    More videos on dotnet core and please use your original voice. Thank you

    • @PoornaSoysaTech
      @PoornaSoysaTech 14 днів тому

      I am planning to do more videos and thanks for your suggestion.

  • @developmentroselino
    @developmentroselino 15 днів тому

    r u that poorna from linked in ?

  • @chrishansangeeth
    @chrishansangeeth 17 днів тому

    Great Tutorial. I have a little question , what is the purpose of using AsNoTracking() with IEnumerable , GetAll List ?

    • @PoornaSoysaTech
      @PoornaSoysaTech 17 днів тому

      Normally, tracking behavior determines whether Entity Framework Core maintains information about an entity instance in its change tracker. When an entity is tracked, any changes made to it are detected and saved to the database during a call to SaveChanges. No-tracking queries are ideal for read-only scenarios. They typically execute faster since they do not involve setting up change tracking information. That why I used AsNoTracking() for GetAll method.

    • @aneeskhan3112
      @aneeskhan3112 15 днів тому

      When we are not performing any operation on the data and get the data for only reading purpose from SQL.

  • @buck1998
    @buck1998 17 днів тому

    great explanation can you make a video on the EF in deep advance details please

    • @PoornaSoysaTech
      @PoornaSoysaTech 17 днів тому

      Thanks for your feedback. Sure, I will make an EF Core video soon.👍

  • @phillismable6303
    @phillismable6303 18 днів тому

    Really well done but this is about 20% of what you needed to teach., for the next set of videos you could cover: Relationships, Error Trapping, Tokens, Circuit Breakers, Retiries, Timeouts, Logging and finally Aspire as Swagger was so 3 years ago.

    • @PoornaSoysaTech
      @PoornaSoysaTech 17 днів тому

      Sure. Thanks for your feedback. More videos are working.

  • @AslamNazeerShaikh
    @AslamNazeerShaikh 18 днів тому

    Please keep creating more videos on .net asp.

    • @PoornaSoysaTech
      @PoornaSoysaTech 17 днів тому

      Thanks! More .NET videos are definitely in the works.

  • @worldsnaps2u
    @worldsnaps2u 24 дні тому

    Brave start. Subscribed and I’m following this course. ❤

  • @alexjuniortupapa
    @alexjuniortupapa 24 дні тому

    Gran trabajo 👌

  • @Dreamway_Academy-qq2qe
    @Dreamway_Academy-qq2qe 24 дні тому

    Great Work . Thank you.!

  • @yaroslavpanych2067
    @yaroslavpanych2067 Місяць тому

    Redundant null checks are now redundant and hidden

  • @thomasandrews9355
    @thomasandrews9355 Місяць тому

    Depending on size, id use a look up table. Depends what my goal was