.NET 8 Web API & Entity Framework 🚀 Full CRUD Course (with Code-First Migrations & SQL Server)

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • 🚀 Join the .NET Web Academy: learn.dotnetwebacademy.com
    💖 Support me on Patreon for exclusive source code access: / _patrickgod
    🐦 Let's get social on Twitter/X: / _patrickgod
    🔗 Let's connect on LinkedIn: / patrickgod
    Table of Contents:
    00:00 - .NET 8 Web API & Entity Framework
    01:07 - Starting Off: Creating the Web API Project
    02:43 - Exploring the Project: Detailed Project Overview
    06:54 - Data Modeling: Creating the Entity Class
    08:01 - API Basics: Adding an API Controller
    17:13 - Database Integration: Adding Entity Framework & SQL Server Database
    26:43 - Migration Strategies: Implementing Code First Migrations
    32:05 - Controller Implementation: Detailed Step-by-Step Guide
    35:30 - Retrieving Data: How to Get a Single Entry
    38:49 - Data Creation: Using POST to Create New Entries
    44:19 - Data Update: Modifying Data with PUT Method
    48:30 - Removing Data: Implementing the DELETE Method
    #DotNet #WebAPI #AspNetCore

КОМЕНТАРІ • 126

  • @christopherjimenez7315
    @christopherjimenez7315 Місяць тому +1

    Thank you so much! I struggled for 2 days finding full complete tutorials on creating a full CRUD web API and your tutorial helped so much. Learned about the syntax and what tools to use!

  • @saifsaif8580
    @saifsaif8580 6 місяців тому +4

    since morning i stucked with some errors/exceptions after coming here i got the solution
    thank you so much for a great course

  • @tapewormerbinkosti3141
    @tapewormerbinkosti3141 5 місяців тому

    6:19 Well yeah, REST is very well standardized. Great tutorial!

  • @enigma2886
    @enigma2886 4 місяці тому +1

    This is such an onpoint video. Amazing work !

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

    Fantastic lesson. You are helping understand this so well!! Thank you so much!

  • @bernardodomeneghetti9673
    @bernardodomeneghetti9673 3 місяці тому +2

    You reached a level of trust for me that, i like the video before i start watching it, and at the end i think with my self, "yes, i knew it".
    Congrats for your content, and hugs from Brazil to you, honestly, your channel is the most recommended by me for my friends! Even those who doesn't speak english hahahahaha

    • @PatrickGod
      @PatrickGod  3 місяці тому

      Wow, thank you so much! Really appreciate that!😊

  • @andelsonnicolaslopezysabel2501
    @andelsonnicolaslopezysabel2501 6 місяців тому

    Thanks for the tutorial man, it was absolutely helpful appreciate it.

  • @user-xp2ot3hu7c
    @user-xp2ot3hu7c 4 місяці тому

    Thank you very much for the video tutorial, it became much clearer. It’s a pity that they didn’t use DTO as an example and didn’t break it down into services. I'm waiting for new videos

  • @greghanson7047
    @greghanson7047 6 місяців тому +5

    Absolutely spectacular tutorial. Thank you.

    • @PatrickGod
      @PatrickGod  6 місяців тому

      You're very welcome! Thank you!

  • @FSML
    @FSML 5 місяців тому

    Thanks for the tutorial., it was absolutely helpful. I appreciate it

  • @cemyurtdas8324
    @cemyurtdas8324 7 місяців тому

    This video saved me tooo much. Thank you

  • @97DanielxD
    @97DanielxD 26 днів тому

    Very good video! Thank you for your help and time!

  • @AzimyPc
    @AzimyPc 4 дні тому

    Danke Für das toll Unterricht

  • @Fred_Edx
    @Fred_Edx 7 місяців тому

    This is a great guide for learning.

  • @estivendejesuspadillasantos
    @estivendejesuspadillasantos 5 місяців тому

    I loved how you guess my thoughts in the minute 40:30 about the "List"😆

  • @SinhaFps
    @SinhaFps 2 місяці тому

    Thank you so much for making this video!

  • @danbenton-smith7723
    @danbenton-smith7723 6 днів тому

    Very good video! Thanks!

  • @rezakhakpour7549
    @rezakhakpour7549 4 місяці тому

    thanks man
    refreshed my knowledge

  • @scubaaddict
    @scubaaddict 4 місяці тому +2

    Will Be great to see an example using CRUD and modal popup dialogs

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

    This video is amazing, thank you so much!!!!

  • @eduard.mkrtchyan
    @eduard.mkrtchyan Місяць тому +1

    It's just amazing course for beginners. Good job!

    • @PatrickGod
      @PatrickGod  Місяць тому +1

      Thank you! Appreciate it. 😊

  • @washingtonbotelho8865
    @washingtonbotelho8865 6 місяців тому

    Amazing video, it helps a lot

  • @Glockodile
    @Glockodile 8 місяців тому +6

    Hey Patrick great video, I know most of the stuff you do on Blazor is WebAssembly, is it possible you could do a video on how to add single account identity to a project that you configured without it at project creation, and you already have a database with a connection string?
    Thanks,
    Jordan

  • @aamirrashid5255
    @aamirrashid5255 8 місяців тому +1

    Hi Patrick, would appreciate if you make a video on Blazor server and controller API in one project using dapper generic functions.

  • @misaghn8027
    @misaghn8027 8 місяців тому +1

    Thanks for this video Patrick.

  • @user-fx2mx5mh6x
    @user-fx2mx5mh6x 7 місяців тому

    Hey , i saw error while scaffolding DbContext using CLI , it is possible to do it in .net 8 ?

  • @joshuarudin1391
    @joshuarudin1391 5 місяців тому

    Great tutorial BUT the add row flow doesn’t work if the table has a primary key that’s auto-increment for unique ID. How would you alter the code to support an auto-increment primary key?

  • @user-sy9vv7oj1i
    @user-sy9vv7oj1i 7 місяців тому

    2:09
    my visual studio show .net 8 preview only
    how can i add .net8 lts version?

  • @dani118biseskracht
    @dani118biseskracht 4 місяці тому

    Hi thanks for this video.
    I have a question...
    I attach a breakpoint in my code but they never hit. Why? And how can ich fix it,

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

    Great video. Thanks a lot.

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

    absolutely amazing content

  • @azraiqbal187
    @azraiqbal187 7 місяців тому +1

    Which machine are you using for the development and video production?

  • @nelsonrivers8546
    @nelsonrivers8546 7 місяців тому +8

    Thank you. Be great if you could do the Database-First implementation whenever you show the Code-First implementation.

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

      I think it's related but not necessary. Database-First is used on existing database model to convert it to classes, useful when migrating application, e.g. .Net 7 apps to .Net 8

  • @renealbrechtsen9743
    @renealbrechtsen9743 5 місяців тому

    How do i connect to a mysql database ive made with docker ? What's the connection string ?

  • @ednilsonaraujo3059
    @ednilsonaraujo3059 3 місяці тому

    Thank uou guy, for this fantastic video.

  • @rodrigovera8253
    @rodrigovera8253 5 місяців тому +1

    excelent. Great tutorial

  • @hamidkadkhoda6966
    @hamidkadkhoda6966 8 місяців тому

    i preciated for your works

  • @idwerke1885
    @idwerke1885 7 місяців тому

    is there any sample if using existing DB with .NET 8

  • @abraaovinicius7671
    @abraaovinicius7671 4 місяці тому +1

    Man this is insane, thanks, so much thanks i love you.

  • @ericianino
    @ericianino 25 днів тому

    Great Video!

  • @MrChuperk
    @MrChuperk 4 місяці тому

    what server do you connect to in sql server studio?

  • @eudeamonism
    @eudeamonism 6 місяців тому

    I went to the Academy link, but it didn't show any courses available. :(

  • @nikolozinakopia4833
    @nikolozinakopia4833 4 місяці тому

    Which line of code here automatically increments the id? not in migration.

  • @Jalaveyan
    @Jalaveyan 4 місяці тому

    Thanks bro!

  • @darenbaker4569
    @darenbaker4569 3 місяці тому

    Thanks for explaining the .http file deleted without knowing what was for lol. But swagger and postman are still the winners.

  • @SophieneMaroc
    @SophieneMaroc 2 місяці тому

    Do you know why I’ve really often the message : attempting to reconnect to the server ?

  • @JuniorGodoes
    @JuniorGodoes 6 місяців тому

    Really good 👍🏻

  • @carlos_garcia_
    @carlos_garcia_ 6 місяців тому

    When update why not return the Hero that is being updated instead of full list of heroes. How can I do it? Great Video to learn the CRUD operations .NET 8 tahnk you!!

  • @lucasfernandes1657
    @lucasfernandes1657 2 місяці тому

    Amazing, thank u sooooo

  • @mejiavaldez
    @mejiavaldez 2 місяці тому

    Thanks a lot!

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

    how migration will be happened in Staging and prod env

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

    awesome content

  • @tejastank2003
    @tejastank2003 5 місяців тому

    can you provide command used to create project in vs code

  • @hoseinmaghoul8876
    @hoseinmaghoul8876 4 місяці тому

    thx for this cool course

  • @christiansandoval7465
    @christiansandoval7465 5 місяців тому

    Youre the best!

  • @marcossequeira5433
    @marcossequeira5433 6 місяців тому

    47:00 i think that you are not using the improved that EF 8 includes like Bulk Updates

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

    thanks!

  • @User.2024.1
    @User.2024.1 4 місяці тому +1

    How EF Core [8] is different from .Net [8] ?
    Maybe explain in another video the difference and purpose of each.
    Thanks.

  • @vatokalandadze6184
    @vatokalandadze6184 7 місяців тому

    hello patrick i have a question if i know how to make Web API does it count as backend developer? i mean does that means that i am a backend? (Also nice video and good luck

  • @MohamedsamiKhiari
    @MohamedsamiKhiari 4 місяці тому

    thank you

  • @joonat5720
    @joonat5720 5 місяців тому +1

    Clear and beautiful as usual. Thank you for sharing! I might ask my boss to pay me for the academy, but I don't know if they will agree :D

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

    Great Video! you said that you wouldn't inject the DataContext in the controller, but instead inject the "Service" into the constructor of the controller?
    For SQLServer, i'm guessing you would inject the db service in the program.cs file as a AddScope injection?
    and then use it to access the db in all your controllers?

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

      It's a great practice to handle DataContext using Interface/Service rather than declaring it in the controllers so when the DataContext changes, you only make changes to the construct of the Interface/Service (meaning you only change it in a single location, instead of modifying all the controllers that is using the same context).

  • @2pro735
    @2pro735 8 місяців тому +9

    Hello
    Thank you very much for your videos.
    If possible a tutorial on.
    Custom authentication from scratch.
    Use of Tokens & Cookies.
    and put Claims authentication on the server and client side.
    Thank you very much.

  • @mirkoargamasilla1747
    @mirkoargamasilla1747 2 місяці тому +1

    Thanks!

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

      Thank YOU! Very kind of you! ❤️

  • @user-co9ne8gi2d
    @user-co9ne8gi2d 8 місяців тому +2

    It would be a God-send (see what I did?) if you could do a video on implementing Single Sign-On / multiple apps sharing authentication in Blazor. I'm struggling with this right now and it seems a lot of other people are too.

  • @dariobarnes3059
    @dariobarnes3059 7 місяців тому

    Hi Patrick, great turorial, thanks! However... when this is published to a folder for local IIS it returns a 500 error :/ any idea why? I've scoured the internet and there doesn't appear to be a solution.

    • @2pro735
      @2pro735 7 місяців тому

      By sending more explanations, we can solve this error, but I'm sorry. be solved like this
      in the file
      appsettings.json
      instead of local IP
      Replace the domain address

  • @mattbrave8040
    @mattbrave8040 5 місяців тому

    min 34:20 he just say " Pay attention here" *PAM, ADVERTISMENT* such a humor sense xDD

  • @user-vl5ut7ml9o
    @user-vl5ut7ml9o 4 місяці тому

    Hi Patrick, do you have theoretical written study material in your .net paid course?
    I'm interested because I don't know English well and I can't understand your speech well

  • @netrunner1987
    @netrunner1987 8 місяців тому +1

    At time 46:49, what keystrokes did you use to multi rename hero to updateHero? Ah.. control r twice , I never used that .. very cool.

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

    I need exmble with ado and combobox

  • @csElvisale
    @csElvisale 7 місяців тому

    De los mejores

  • @greyabeing443
    @greyabeing443 8 місяців тому +11

    can you create a playlist with all .NET 8 videos

    • @PatrickGod
      @PatrickGod  8 місяців тому +7

      Here it is: ua-cam.com/play/PLF1jhYUTnHo4xzSbrznUEAsIl7upw3X7K.html Enjoy! ❤

  • @souravsingha3340
    @souravsingha3340 8 місяців тому

    Please make video about graphql... With authorization

  • @DavidPHH
    @DavidPHH 6 місяців тому +1

    Would you have any link to an example of the "proper" way you mentioned to do the controller please? Instead of the "fat controller". I'm new to .NET and don't know how to google what you said.

    • @kylejsarte
      @kylejsarte 6 місяців тому +1

      Hi David. The term you're looking for is "Repository Pattern". You'll find relevant documentation if you Google "Repository Pattern" and "Entity Framework" together.

  • @adilaitdaoud6015
    @adilaitdaoud6015 7 місяців тому

    keep going

  • @MuhammadNadeem11001
    @MuhammadNadeem11001 6 місяців тому +1

    great

  • @farahhashim7441
    @farahhashim7441 2 місяці тому +1

    you are GREAT

    • @PatrickGod
      @PatrickGod  2 місяці тому +1

      YOU are great! 😊

    • @farahhashim7441
      @farahhashim7441 2 місяці тому +1

      @@PatrickGod
      Sir Plz Can you Create an ERP system 🙂

  • @saifsaif8580
    @saifsaif8580 4 місяці тому

    can you make a video .NET 8 web API connecting with oracle SQL Developer?

  • @jesunbicar5489
    @jesunbicar5489 3 місяці тому

    Quick question.. What is the main purpose for the migration?
    Will it be still needed if i create a database tables on SQL directly?
    Do you have any article regarding the migration
    Thanks..

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

      Data migration's main purpose is to create the database structure using the entities (tables) you have created, and apply all the changes to your database every time when you made changes to your entities.
      Meaning when the entities change (you added a new entity, you changed a column name in an existing entity, or you changed the column type), data migration will see these changes and will create a migration script (when you use the add-migration command) that will match the changes when you use the update-database command.
      Data migration keeps track on the changes you make on your code, and matches the structure of your database. As your app grows, your tables grows, and you don't need to manage it thru your SSMS (which is a great headache later on in production).

  • @mds6941
    @mds6941 Місяць тому +1

    what previous knowledge or skills should i have to watch this course I am new and I just finished a c# fundamentals course
    please reply😊

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

      I suggest you check the title and search for those topics: .NET 8, Web API, Entity Framework, Code-First Migrations & SQL Server

  • @H3artFang
    @H3artFang 2 місяці тому

    what is a reposiitory? a code repositiory? or somethnig dfiferent? also could youu show how to implement a service and a repository? can't fiind any info really onlinie, just argumments by people

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

      A repository is a code pattern where your data access is abstracted to a class that attempts to mimic your data as an in memory list. It is popular in Domain Driven Design

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

    ti amo grazie a te posso adottare coccioli yeahh

  • @ShyamYadav-yh9de
    @ShyamYadav-yh9de 3 місяці тому

    Make a of Angular 17 and . net 8

  • @DJKav
    @DJKav 6 місяців тому +1

    I'd love to see a MySQL server version of these types of video.
    Not all of us, here in the UK can get decent .Net hosting with more than one MS SQL DB, while having pretty much unlimited MySQL DBs on the same hosting as he single MS SQL DB.

    • @xanderperlee1448
      @xanderperlee1448 6 місяців тому

      did you @PixelProfessor already get it working with Mysql because im stuck trying?

    • @DJKav
      @DJKav 6 місяців тому

      @@xanderperlee1448 Not yet I'm still beavering away.
      I'm using the nuget packages (latest 8 versions, or pre-release);
      Microsoft.EntityFrameworkCore
      MySql.Connector
      Pomelo.EntityFrameworkCore.MySql
      I did get to a stage where the EF migrations set up the DB tables on MySQL.
      I might go back to a new Blazor Web API project, and start following the tutorial again. Trying to implement the MySQL stuff.

  • @unskeptable
    @unskeptable 7 місяців тому

    I like i subscribe

  • @davestorm6718
    @davestorm6718 2 місяці тому

    How does the API know how to update the superhero (PUT) without using _context.SuperHeroes.Update(dbHero); ?

  • @omaralnayme8004
    @omaralnayme8004 7 місяців тому

    Great video. Can you Please do one video that deals with the existing database? That is we do not need to create it from VS2022.

  • @xavierdunifon8413
    @xavierdunifon8413 4 місяці тому

    14:15 anyone else hear this in Matt Berry's "new york citaayy" voice

  • @Videox2024
    @Videox2024 7 місяців тому

    I love you

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

    i love u

  • @danielrochasantana3951
    @danielrochasantana3951 6 місяців тому

    good afternoon!
    gift - documentary:
    ua-cam.com/video/-sQmSBJgNj8/v-deo.html
    good week!

  • @user-zu9xl5dr3w
    @user-zu9xl5dr3w 3 місяці тому

    Hi Your teaching way is too good
    But I thought you would tell new thing in .net 8.0 but it just normal video 😟😟

  • @ShyamYadav-yh9de
    @ShyamYadav-yh9de 3 місяці тому

    🥰🥰🥰🥰🥰

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

    i guess u are not going to reply

  • @GatewaytoRichnessTamil
    @GatewaytoRichnessTamil 7 місяців тому

    All the big tech companies are using Java.. Sir if we study dotnet then there will be future

  • @dasfahrer8187
    @dasfahrer8187 8 місяців тому +2

    Minimal API >>>> controllers in just about every way.

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

    you are, in fact, the goat🥹

  • @rionhoxha123gmail
    @rionhoxha123gmail 3 місяці тому

    Thank you so much you were so clear just try sometimes to do a example with a more real example not with heroes hahahaha