ASP.NET Core Web API + Entity Framework Core : Database First - EP01

Поділитися
Вставка
  • Опубліковано 24 січ 2025

КОМЕНТАРІ • 249

  • @CuriousDrive
    @CuriousDrive  4 роки тому +12

    Code - github.com/CuriousDrive/BookStores
    Thanks for watching, please share with your friends :)

    • @waqasriaz30
      @waqasriaz30 3 роки тому +1

      I want to follow along the way in this tutorial series. I didn't find your BookStore.bak file as shown in the video. Please guide.

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Please create a database named "BookStoresDB" and then run this script - www.github.com/CuriousDrive/BookStores/tree/master/Database%2FGenerateData.sql

    • @waqasriaz30
      @waqasriaz30 3 роки тому +1

      @@CuriousDrive thanks. It worked like a charm.

    • @taha5871
      @taha5871 2 роки тому

      Prefer to put file .bat and we just import it.

  • @Lolatyou332
    @Lolatyou332 5 років тому +7

    Starting my own business, have a couple years of coding experience but not in all the right places yet. This and your blazor videos will help out, thanks. Hope your channel keeps growing as blazor gets more popular.

    • @CuriousDrive
      @CuriousDrive  5 років тому +6

      Starting a new business is lot work. I am glad that the videos are helping you. I try my best to explain the concepts.
      Don't hesitate to contact if you get stuck anywhere. Thanks for watching 😊

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

      @@CuriousDrive you are so nice person thanks for to kind behaviour Allah always bless you.

  • @svantepanter
    @svantepanter 4 роки тому +6

    Great tutorial, thank you! Right what I was looking for. When researching this topic (Web API) there is often a lot about interface and repository. The approach you showed is more easy to grasp for a beginner.

    • @CuriousDrive
      @CuriousDrive  4 роки тому +2

      Yes the idea was to get people started with entity framework instead scaring them. Thanks for a lovely comment 😊

  • @yogeshkulkarni9406
    @yogeshkulkarni9406 4 роки тому

    This is a good tutorial. I am yet to watch remaining videos in the list, but I must say that the beginning is good :) Thank you..

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Thanks Yogesh. Let me know if you run into any issues.

  • @simonroyjonesuk
    @simonroyjonesuk 3 роки тому +2

    Brilliant video. Very clear and I learnt a lot. Thank you.

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Thanks for watching Simon. I made another video in which I made this process even easier and covered more topics. Hopefully this one will be helpful.
      ua-cam.com/video/DoYmpAPoixI/v-deo.html

  • @kumaresanettiyannan6453
    @kumaresanettiyannan6453 3 роки тому +2

    Awesome tutorial.. crisp and clear information. thank you.

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Thanks for watching Kumaresan, Please share with your friends :)

  • @ramarch0803
    @ramarch0803 4 роки тому +1

    Thank you so much, this video is amazing from all videos which are uploaded on youtube really thank you so much...

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Thanks for watching Riti. Please share with your friends :)

  • @thainguyenphuong9154
    @thainguyenphuong9154 3 роки тому +1

    Video is very important to me. Thank you bro!

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      I am glad this was helpful to you. Please share with your friends :)

  • @paul46722
    @paul46722 4 роки тому +1

    Thanks for the clear tutorial. I normally use SQL Server with stored procs and data access layers. This EF is all new to me so it's very useful.

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Yes, it's very easy to use. Makes our lives easier. Thanks for watching the video.

  • @waqasriaz30
    @waqasriaz30 3 роки тому +1

    A comprehensive video series. Loved your videos.

    There were two abruptions I faced when following your video series and can be improved:
    1.
    The user login method wasn't created when using visual studio > add controller > scaffold new item.
    I presume you made it backstage and later in your uploaded videos, it suddenly appeared to viewers.
    Even, the scaffolding part was missing.
    2.
    The link to your GitHub project > 'code.txt' file doesn't contain the code you showed in the videos.
    For the students, the video series is worth giving time. I learned a lot in such a short video series about Web API and associated tooling to professionally handle this project. The knowledge given in this series highly overrides the above abruptions being pointed.

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Thanks Waqas, that's an awesome feedback. I see what you are saying about the login method. I did add that behind the scenes and did not scaffold it. But visual studio wouldn't have scaffolded as it not one of the EF Core method. I hope that makes sense.
      And I used "code.txt" file for back up, it is not part of the tutorial.
      Thanks again for suggesting this tutorial to students.

  • @WikkiOnIlluminati
    @WikkiOnIlluminati 4 роки тому +1

    Awesome video series.
    Best and quick learning.
    thanks

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Thanks for watching Wikki. and thanks for a lovely comment.

  • @pw.70
    @pw.70 3 роки тому +2

    Simple and concise - thank-you.

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Thanks for a lovely comment P W. I am glad you found the video helpful

  • @leratomphahlele1908
    @leratomphahlele1908 3 роки тому

    Best series I found on the topic

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Thanks for a lovely comment lerato :)

  • @arifjaved592
    @arifjaved592 4 роки тому +1

    Probably the best video series to learn reverse engineering in . Net core web api.. Thank you so much sir.. If possible please make videos where we will have to join tables in db first approach using ef core

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      Thank you so much for kind words Arif.
      Actually, I have already made a video on loading data from related tables.
      Loading related data video -> ua-cam.com/video/YucN7Qu_LDs/v-deo.html
      and you can find the whole series here -> ua-cam.com/play/PL4WEkbdagHIQVbiTwos0E38VghMJA06OT.html

    • @arifjaved592
      @arifjaved592 4 роки тому +1

      @@CuriousDrive actually i am new to your channel... I will surely go through all of ur videos.. Keep making such videos sir

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Welcome to the channel. Please subscribe and share with your friends.
      You can also ask questions on Sunday morning live stream. Please try to be part of it.

  • @codingwithelhacen990
    @codingwithelhacen990 3 роки тому

    New Subscriber here. Thank you for sharing this video. Great explanation! Please keep up the great work. Followed through with no problem.

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Thanks for an awesome. Let me know if you run into any issues.

  • @alfonsovillegas489
    @alfonsovillegas489 5 років тому +3

    Thanks for this. I hope you can cover on future parts how to create an independent method for each CRUD operation instead of using the same method for all operations... And how to call each method from one on the UI technologies you mention at the begining.

    • @CuriousDrive
      @CuriousDrive  5 років тому +2

      Yes. I am going to cover all the important features of Entity Framework Core and ASP.NET Core Web API in this series. And the idea is to call this Web API from my Blazor and Xamarin project that I have already posted on my channel. And hopefully I can also call it from flutter,android and all the other cool languages in next projects....

    • @alfonsovillegas489
      @alfonsovillegas489 5 років тому +2

      Curious Drive That’s amazing, will keep in touch, subscribed!

  • @emilgabrielharabagiu898
    @emilgabrielharabagiu898 4 роки тому +1

    Can somebody explain to me why he has "bookAuthors" array at 9:50? The model generated by scaffolding command made the field for that? When i use it myself, it was not created. Thank you in advance!

    • @emilgabrielharabagiu898
      @emilgabrielharabagiu898 4 роки тому +1

      Nvm, i got it!

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      I am glad that you figured it out

    • @emilgabrielharabagiu898
      @emilgabrielharabagiu898 4 роки тому

      @@CuriousDrive Thank you for making such a greate videos! I want to ask you something: there is any chance to make a video about implementing JWT in Angular? I think there are alot of people who are searching for frontend stuff explained in the way you do.

  • @stoic2454
    @stoic2454 4 роки тому +2

    This is awesome, loved your vdo, easy to understand, to the point, thank you so much.

  • @greendeer2437
    @greendeer2437 3 роки тому +1

    Hi great tutorial!
    But how did you get the BookStoreDB at 2:40 is that something you made earlier? If so how would I create it? Or If you know any other tutorials similar that I could look at that would be great.

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Hello Green Deer, I have added the DB script to generate the BookStoresDB. Please check below GitHub repo for that.
      github.com/CuriousDrive/BookStores

  • @yigitcankeskin8659
    @yigitcankeskin8659 2 роки тому +1

    so good video , THANK SO MUCH.

    • @CuriousDrive
      @CuriousDrive  2 роки тому

      Thanks for watching yiğitcan keskin!!!

  • @ahmetselcukzengin7664
    @ahmetselcukzengin7664 2 роки тому +1

    Thanks a lot , great tutorial and reminder (:

  • @gokul4060
    @gokul4060 4 роки тому +2

    Hi. How to use db scaffold if a table doesnt have any primary key? I am able to use the command. but get an exception while making the request- InvalidOperationException: The navigation '' cannot be added because it targets the keyless entity type ''. Navigations can only target entity types with keys.

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      I don't think it is currently possible. Even I did not know about this until I googled about it. Please check below resources.
      stackoverflow.com/questions/39701068/scaffold-dbcontext-creating-model-for-table-without-a-primary-key
      github.com/dotnet/efcore/issues/5719
      github.com/dotnet/efcore/issues/5913

    • @gokul4060
      @gokul4060 4 роки тому

      @@CuriousDrive Thank you for quick reply :)

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Thanks for asking very good question Gokul. Please subscribe to the channel and share with others :)

  • @guillermoruiz3568
    @guillermoruiz3568 5 років тому +5

    Hi, this is the first video that I see and I really liked it, you have a new subscriber. If you fix a new project, use DataBaseFirst or CodeFirst?

    • @CuriousDrive
      @CuriousDrive  5 років тому +3

      Honestly it depends on the size of your project.
      If you are making a project where you have less than 10 tables and you don't really care about your data in the future then CodeFirst is a easy and fast approach.
      But you have lot of data now or there will be in future then I would go with DatabaseFirst approach. Because then I have freedom to switch to any other ORM framework. And you won't have to maintain your migrations.
      Your architecture should be independent of your framework. Always build your base first. that's how I code :)

  • @natep7425
    @natep7425 2 роки тому +2

    Great content! I have a question, for the Scaffolding Command, what happens if you want to update the EF based on new updates made to the database? What is the command for that?

    • @CuriousDrive
      @CuriousDrive  2 роки тому +1

      Hello Nate. same command. Just use "-f" at the end of the command. That regenerates the models and DdContext and overrides the current files with updated models. Please check below article.
      docs.microsoft.com/en-us/ef/core/managing-schemas/scaffolding?tabs=dotnet-core-cli#updating-the-model

  • @shaikhakhtar3857
    @shaikhakhtar3857 5 років тому +2

    Really nice video,
    Please make videos on step by step project implemention too

    • @CuriousDrive
      @CuriousDrive  5 років тому +1

      Hi Akhtar, I am not sure if I am following your feedback. Can you please elaborate?

  • @Artavazd.kirakosyan
    @Artavazd.kirakosyan 4 роки тому +1

    let me ask one more question, as I understood, whenever we make a call to database, we create new instance of context, and as so, we pull of all of the data (including all of BbSetsName ) from databases to our context object. did I get correct? in other word, this approach is assumes heavy data transfer from/to database .

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      No. EF core does not make call to the database when you create the instance of DBContext. It makes calls when you access the DBSet. And if you use LINQ to filter your collection then it creates the query with where condition. Performance was the main focus when they were designing EF core. I hope that makes sense

    • @Artavazd.kirakosyan
      @Artavazd.kirakosyan 4 роки тому

      @@CuriousDrive Thanks for the explanation.

  • @Artavazd.kirakosyan
    @Artavazd.kirakosyan 4 роки тому +2

    I got a question to ask regarding to controller, here you use very simple way to connect to database to pull or add a new data (i.e. author). in other cases, many people use dependency injection where they need to go through series of settings in startup, repositories, and controller (particularly dependency injection in controller). just wondering which approach is preferable? this one (i.e. using(new connection object ... )) is obviously more simple in terms of configuring and using in controller....

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      Artavazd, that's a great question. The reason why I did not use dependency injection in this case because it would had been difficult for beginners to understand EF Core. But if your DI concepts are clear and you know how your app should be structured to be durable then please use DI.

    • @Artavazd.kirakosyan
      @Artavazd.kirakosyan 4 роки тому

      @@CuriousDrive thanks for replay. I got your point. better to learn and understand the both approach.

  • @Vitoman123
    @Vitoman123 3 роки тому +1

    Thank you. Very good tutorial

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Thanks for watching Viktor. Please share with frandzzz :)

  • @athiraramachandranl1605
    @athiraramachandranl1605 3 роки тому +1

    Iam using Postgresql. When Iam connecting using command Build fail msg is showing in console. Default project and connection is correct. Could u help for this

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Hello Athira, If you are getting build error when you run the command then you have build errors in the current solution. Please fix those and then run the command. If you are getting build error after running this scaffolding command then please share the error message. I will try and look up the error. It could be something related to PostgreSQL database.

  • @josephdsilva4941
    @josephdsilva4941 2 роки тому

    Very Useful Content, Thanks a lot...

  • @AMIRKHAN-dm2fm
    @AMIRKHAN-dm2fm 4 роки тому +2

    Thanks but I have question?
    How we can create multiple Get Methods in a same Controller with different method names.?

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      Yes totally. As we progress in the series, I am creating multiple GET methods in a controller.

    • @AMIRKHAN-dm2fm
      @AMIRKHAN-dm2fm 4 роки тому

      @@CuriousDrive Thanks I am waiting and plz try to make tutorials for how to consume WEB APIs in Xamarin.Forms with Azure like a complete realtime application.

  • @cwmizner
    @cwmizner Рік тому

    Outstanding, thank you!

  • @auchucknorris
    @auchucknorris 3 роки тому +1

    question on the "using" statement I'm new to c# and was just wondering what this called due to the size or Bookstoredbcontext and wanted to dispose of this reference after being implemented?

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      I am glad to hear that you are learning C#. "using" statement is used when you want to dispose the object after the code block. This is usually used with the objects which use lot of resources or open connections when they are initialized. We don't want those objects in the memory forever.

    • @auchucknorris
      @auchucknorris 3 роки тому

      @@CuriousDrive I'm sure it way is fine but I see most places use the read-only with constructor approach rather than using

  • @KearlHat
    @KearlHat 3 роки тому +1

    How to run sql against context or create a json structure like "books by publisher"?

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Hello Kearl, I think you are looking for loading related data. I made a video about it in the same series. Please check the video below.
      ua-cam.com/video/YucN7Qu_LDs/v-deo.html

  • @theachyller69
    @theachyller69 4 роки тому +1

    You're saving my live!!!!! thanks man

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Thanks for watching Tang. Let me know if you run into any issues :)

  • @mithileshpandey9885
    @mithileshpandey9885 3 роки тому +1

    in asp.net core web api :
    if there are 10 method in one controller
    i want 10 method return in json formate
    and 10 method return in xml formate then how will do it?

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Hello Mithilesh, sorry for the late reply. Please check below article for producing responses in different formats
      docs.microsoft.com/en-us/aspnet/core/web-api/advanced/formatting?view=aspnetcore-5.0

  • @gbmarshall
    @gbmarshall 2 роки тому

    I have a large database with 190 tables... I've generated the entity framework model... how do I auto generate the web api from the entity framework model? I don't want to do it buy adding a controller for each table...

  • @selvakumarv1341
    @selvakumarv1341 3 роки тому +2

    Hi friend,
    How can i get data through stored procedures?

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Hello Selvakumar, Please follow this article for calling stored procedures in EF core.
      www.entityframeworktutorial.net/efcore/working-with-stored-procedure-in-ef-core.aspx

    • @selvakumarv1341
      @selvakumarv1341 3 роки тому

      Thanks 😊

  • @mememonster2370
    @mememonster2370 2 роки тому +1

    wat if i added new table in sql server?
    i should create model manually

    • @CuriousDrive
      @CuriousDrive  2 роки тому

      I have a feeling that you have already watched rest of the series already. That must have answered your question

  • @chaabanitasnim9376
    @chaabanitasnim9376 4 роки тому +2

    This was useful, however I have a problem! Evertime I run the Scaffold-DbContext command it says "Build Failed" can anyone help me with that ?

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Hello Chandini, that means you have syntax error somewhere in the code and you will have to fix it before scaffolding your database.

    • @ncastillozam
      @ncastillozam 4 роки тому

      Esto sucede porque tienes que tener el "Sql Server Management Studio" Conectado, ejecútalo para que tu instancia este disponible y se pueda realizar el Scaffold, saludos

  • @nehagarg9091
    @nehagarg9091 4 роки тому +1

    Hey. I am geting,
    InvalidOperationException: No database provider has been configured for this DbContext.
    Issue Description
    , can you suggest possible solution.

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      It looks like project is not able find which DB provider you are using. Did you install SQL Server DB provider? If not then you can get it from - www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer/
      Also when do you get this error message. When you compile, run or some other time?

  • @shashikantkasera
    @shashikantkasera Рік тому

    how to solve this issue ( A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)) , i am using .net core 7

  • @BudiSantoso-er6cq
    @BudiSantoso-er6cq 4 роки тому +1

    Great tutorial, thanks very much bro..

  • @Mimsy124
    @Mimsy124 4 роки тому +1

    The luckiest number ever :)
    Nice video , thanks a lot

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      It's fun making these demos. Thanks for watching :)

  • @yudaguntoro9327
    @yudaguntoro9327 2 роки тому +1

    how i can share my API and request from another PC with local network ?

    • @CuriousDrive
      @CuriousDrive  2 роки тому

      You can run the API and share the IP address of your machine and port number on which the API is running on to whoever wants to use it. Or you can host it on IIS. I have made a video about it. Please check the link below.
      ua-cam.com/video/b0v4_Kv4_RA/v-deo.html

  • @mp-ot7fw
    @mp-ot7fw 4 роки тому +1

    Thanks for the refresher on scaffolding and EF, and for showing me how to create an API. How did you make your data list show with carriage returns? Mine shows across my browser window without line breaks. Is that a rendering setting somewhere?

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      It's json formatter chrome extension. 😊

    • @mp-ot7fw
      @mp-ot7fw 4 роки тому

      @@CuriousDrive Thanks that worked!

  • @ersingencer80
    @ersingencer80 2 роки тому

    so simple and great tutorial thank you so much

  • @whooomzoilo4833
    @whooomzoilo4833 3 роки тому +1

    If i have a Burger class with salad class relationship and the salad i want is already in the database, how do I connect it to my new burger when I add it to database??

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Hello Whoomz, great question. Please check my video on "Loading Related Data". Link below.
      ua-cam.com/video/YucN7Qu_LDs/v-deo.html

  • @chrispotvin5977
    @chrispotvin5977 5 років тому +3

    Could you include the mdf file to your db? the.Bak file is incompatible with my server version. Alternatively, you could include the query you used ot create the file. TIA.

    • @CuriousDrive
      @CuriousDrive  5 років тому +2

      @Chris - I added the script in GitHub repo, which will generate schema and data for you. :)

    • @ajanyhc
      @ajanyhc 4 роки тому

      @@CuriousDrive I installed the latest sqlexpress and followed you instruction on how to regenerate the schema, but getting error "Severity Code Description Project File Line Suppression State
      Error SQL80001: 'SORT_IN_TEMPDB' is not a recognized CREATE TABLE option. BookStoresWebAPI C:\Learn\MicroSoft\UsingVisualStudio\Blazor\BookStoresWebAPI\GenerateData.sql 939
      " when I tried to execute the query file. Any suggestion?

    • @ajanyhc
      @ajanyhc 4 роки тому

      I deleted the 'offending' line --> reran the query --> GOOD!!!

  • @talkathiriify
    @talkathiriify 5 років тому +3

    Amazing
    Thank you very much.

  • @janmarcinkowski7184
    @janmarcinkowski7184 3 роки тому +1

    When I run Scaffolding Command. I get this error:
    The specified deps.json [D:\git\INT3RCEPT0R\Magazyn\MagazynSkladowania\MagazynSkladowania\MagazynSkladowania.deps.json] does not exist
    Can You help me?

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      What version of dotnet are you using?

    • @janmarcinkowski7184
      @janmarcinkowski7184 3 роки тому

      @@CuriousDrive Microsoft .NET Framework Version 4.8.04084

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      That's why you are getting that error. This command is for .net core 3.1 or greater. I would suggest installing .net 5 as that's latest

    • @janmarcinkowski7184
      @janmarcinkowski7184 3 роки тому

      @@CuriousDrive How and Where can I change it?

    • @janmarcinkowski7184
      @janmarcinkowski7184 3 роки тому

      @@CuriousDrive When I create new project in .NET Core 3.1 (LTS). I get same error

  • @sabarinathkr7603
    @sabarinathkr7603 4 роки тому +1

    Getting this Error on running Saffolding command - Exception has been thrown by the target of an invocation.

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Can you please paste the whole stack trace here? I am not sure why you are getting the error. Maybe you don't have the correct .NET framework installed.

    • @Abie169
      @Abie169 3 роки тому

      I use this command and works Scaffold-DbContext -Connection "Server=.;Database=BookStoresDB;Integrated Security=True;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

  • @moliv8927
    @moliv8927 4 роки тому +1

    Amazing video!

  • @anbhuonline
    @anbhuonline Рік тому

    am i the one not able to find the .bak file in the said git link?

  • @toddcagelives
    @toddcagelives 3 роки тому +1

    The DbSets are plural in the latest release :)

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Yes. I noticed that. I am actually working on creating another video series for EF Core .NET5 and .NET6(when it gets released).
      Thanks for your comment. I am sure that will help others.

  • @IPanonima17
    @IPanonima17 4 роки тому +1

    you have saved my semester, thanks a lot

  • @danhnguyenthanh8849
    @danhnguyenthanh8849 2 роки тому

    Great video

  • @doncharly7723
    @doncharly7723 4 роки тому +11

    Is it possible for you to increase the sound and upload the files? This sound is very feeble. Video looks great.

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      They seem to be fine for other people. You can download this video and use some online tools to increase audio gain f you'd like. I will loose view counts if I re-upload these videos, also subscribers won't like that.

    • @svantepanter
      @svantepanter 4 роки тому

      Works fine for me!

  • @ioanabondoc3844
    @ioanabondoc3844 4 роки тому +1

    Hello! Is there a reason why you installed 3.0.0 and not 3.0.1? I know you said you've created 3.0 Web API project, so in this case you cannot install packages that are greater than 3.0.0?

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      When was working on this demo, 3.0.1 had just come out. And I did not want to run into the issues during the demo. But it should work just fine. Actually, I suggest viewers to install the latest .NET

    • @ioanabondoc3844
      @ioanabondoc3844 4 роки тому +1

      @@CuriousDrive thanks. I usually don't install the latest latest because it's possible to not work with tutorials in general and to search for the solutions all over the internet :)) (I only do school projects)

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      Ohh okay. Let me know if you run into any issues. Here to help!!!

  • @phongvu2431
    @phongvu2431 3 роки тому +1

    Can you share first database? i found the database on your github but i want the original database at the start of the course

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      I am afraid I don't have that anymore. Are you facing any issues running below query?
      github.com/CuriousDrive/BookStores/blob/master/Database/GenerateData.sql

  • @charlesm.1638
    @charlesm.1638 4 роки тому +1

    What about getting the record based on the id entered into the get?

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      Hey Charelse, I covered that part in below demo.
      ua-cam.com/video/uPJ2-6YPRjM/v-deo.html
      Let me know if you have questions related to that video.

    • @charlesm.1638
      @charlesm.1638 4 роки тому

      @@CuriousDrive Thank you.

  • @Artavazd.kirakosyan
    @Artavazd.kirakosyan 4 роки тому +1

    thanks for the video, trying to import the databas.bak file, but failed, any tips or advise?

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      You are welcome Artavazd, you can use below query to generate the data. Please follow the instructions on the GitHub repo.
      github.com/CuriousDrive/BookStores/blob/master/Database/GenerateData.sql

    • @Artavazd.kirakosyan
      @Artavazd.kirakosyan 4 роки тому

      ​@@CuriousDrive thank you very much for your help. it worked, but something was really strange happen... when I downloaded the file, and then I imported that file to server management studio, it did not work, so I had to open the file in web browser, copy the contents from the browser into the new query file, and then execute it, otherwise, the generatedata.sql file didn't work... when I checked the contents of the generatedata.sql file in notepad, it turned out that it has a mainly html tags (similat of the github page),....

  • @nadaraialuka
    @nadaraialuka 3 роки тому +1

    Luv you maaaan

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Love you too bruh!! Thanks for watching. Please share with your friends :)

  • @amnesia3490
    @amnesia3490 3 роки тому +1

    How can I add Identity for existing database ?

    • @CuriousDrive
      @CuriousDrive  3 роки тому +1

      I would create a Blazor app with Auth support in it and then replace the connection string in the app with the connection string of your database and then spin it off for generating the identity columns.

  • @jomarsalazar2572
    @jomarsalazar2572 4 роки тому +1

    Hey can i ask what your database look like before scaffolding it?
    btw I'm using mysql is it necessary for that?

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Sure. Please check file at BookStores/BookStoresWebAPI/Database/Backups/BookStoresDB.sql. If you run this file in your SQL express you will be able to take a look at the data.
      You will have you use Pomelo.EntityFrameworkCore.MySql package to scaffold

    • @jomarsalazar2572
      @jomarsalazar2572 4 роки тому

      @@CuriousDrive ok thanks

  • @imran2march
    @imran2march 5 років тому +1

    Hi
    Amazing work
    Quick question you didnt mention if we need few tables not all the database tables as i have 100 tables and not requires all the tables. Also how we play with sql stored procedure any video for it

    • @CuriousDrive
      @CuriousDrive  5 років тому +1

      Hey Imran, I did miss out on mentioning that. I think I mentioned in comment section of my next video on how to do that.
      I am going to make videos on how to call stored procedure in my future videos I just thought of covering authentication and authorization part first.

  • @mithileshpandey9885
    @mithileshpandey9885 3 роки тому +1

    How to Access/Use/ Call Stored Procedure in Entity Framework Core 3.1 DATABASE First Approach C#

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Mithilesh, I have plans to make another video series on ASP.NET Web API for .NET 5 & 6. I am going to add this topic in the new series. Thanks for the suggestion.

  • @rajasekharareddy7117
    @rajasekharareddy7117 3 роки тому +1

    Hi Man,
    I am new to IT.
    I am getting errors when I restore your Database backup to my SQL SQL server.
    Please can you share the latest backup or script?
    Thanks in advance

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Hi Rajasekhara, I know other people were getting some errors too. I changed the way you can restore the database. Please create a database named "BookStoresDB" then run the script at "BookStores/Database/GenerateData.sql". I have written the instructions at - github.com/CuriousDrive/BookStores

  • @rejithkumar4891
    @rejithkumar4891 4 роки тому

    I am getting below Error
    An assembly specified in the application dependencies manifest (ApplicationName.deps.json) was not found:

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      When are you getting this exception? Have you cloned the GitHub repo?

  • @thyeaa
    @thyeaa 5 років тому +1

    May i know how do you know that after localhost/author? how do you know it is "author"? Have you define it somewhere else? Sorry for asking, i am still new to web api

    • @CuriousDrive
      @CuriousDrive  5 років тому

      You will have to define the route on top of your controller. Like this
      [Authorize]
      [Route("api/[controller]")]
      [ApiController]
      public class AuthorsController : ControllerBase
      {}
      Where [controller] attribute is the name of the controller "AuthorsController". Then the path will be localhost:port/authors

    • @thyeaa
      @thyeaa 5 років тому

      @@CuriousDrive does the "authors" is substring from any strings? Or automatically it will be like that? Is there any docs I can refer to? Thanks.

    • @CuriousDrive
      @CuriousDrive  5 років тому

      Yes. "Authors" is substring of "AuthorsController" hence the path "localhost/authors".
      They have designed it in this way so that developer maintain the consistency through the project.
      Check out this below link. They have mentioned how routing works in ASP.NET web api
      docs.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-3.1&tabs=visual-studio#routing-and-url-paths

  • @flaviusioan69
    @flaviusioan69 4 роки тому +1

    Thnx for this easy tut...

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Thanks for watching Ioan. Please subscribe and share with your friends

  • @kokilakawshalya2380
    @kokilakawshalya2380 4 роки тому

    Hi! when restore the backup file there was an error occurred as "ADDITIONAL INFORMATION:
    System.Data.SqlClient.SqlError: The database was backed up on a server running version 14.00.3006. That version is incompatible with this server, which is running version 11.00.2100. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.SmoExtended)" . how can I restore this backup file.

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Hello Kokila, It looks like the backup is not compatible with your SQL Server. I suggest that you should create the DB named as "BookStores_DEV" and then you can run below query to generate the schema and data in that in DB.
      github.com/CuriousDrive/BookStores/blob/master/Database/GenerateData.sql
      Thanks for watching.

    • @kokilakawshalya2380
      @kokilakawshalya2380 4 роки тому

      @@CuriousDrive thank u so much!

  • @cessargraux
    @cessargraux 4 роки тому +1

    can i do this on linux? how can I add nuget packages in terminal?

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Yes. You can use dotnet CLI commands to install nuget packages on linux or mac machines. Please check the below command for EF Core package.
      dotnet add package Microsoft.EntityFrameworkCore --version 5.0.2

  • @softwareenthusiasm3667
    @softwareenthusiasm3667 2 роки тому

    Instead of adding ,update Author in same [HttpGet] which is not recommended, there are many http method can handle CRUD functionalities.

  • @AjiMustofa-nx1xo
    @AjiMustofa-nx1xo 4 роки тому

    how do I use the database that you provide, I've downloaded it and then after that I enter it into mssqlserver. after I clicked the "execute" button then an error occurred.

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Hello Aji - what error are you getting? Maybe I can update the query to fix it for everyone?

    • @AjiMustofa-nx1xo
      @AjiMustofa-nx1xo 4 роки тому

      @@CuriousDrive There are quite a lot of error messages, such as Incorrect syntax near 'CONTAINMENT' then there is Valid values ​​of the database compatibility level are 80, 90, or 100. And also User does not have permission to alter database 'BookStores_DEV', the database does not exist, or the database is not in a state that allows access checks. At the end of the message, it says ALTER DATABASE statement failed. did I do something wrong? (I'm using mssql server management 2008 by the way)

  • @sunilanthony17
    @sunilanthony17 4 роки тому

    Why store the DB Connection String in your Context instead of Storing it in your appsettings.json?

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Hello Sunil, I fixed that as part next episode. you can find that episode here - ua-cam.com/video/7a7zYOTTXRs/v-deo.html

  • @kandinagireddy
    @kandinagireddy Рік тому

    Tutorial is very good. Are there any new series on .Net 6/7/8/ Web api??

  • @kandinagireddy
    @kandinagireddy Рік тому

    Hi , Is there any update from your channel?

  • @fifigame6089
    @fifigame6089 3 роки тому +1

    Hi there, Nice to meet you, i would like to thank you about your videos ! i have one question regarding JWT Token i have an issue with UserWithToken Model, because when i implemented your code i still have an issue to return UserWithToken Object could you please show me the Model or let me know how can i resolve my issue. Many thanks in advance.

  • @ganesans5641
    @ganesans5641 2 роки тому

    good work and thanx

  • @sujashreemurugesh9106
    @sujashreemurugesh9106 4 роки тому +1

    Awesome tutorial. May i know command for How to remove BooksDBContext and add another Database? Through command prompt package manager console. scaffolding

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Thanks for commenting Sujashree. Is this what you are looking for?
      Scaffold-DbContext 'Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Chinook' Microsoft.EntityFrameworkCore.SqlServer

  • @klsonic
    @klsonic 4 роки тому +1

    Is the web api you've created a rest api?

  • @anirudhsingh8619
    @anirudhsingh8619 3 роки тому +1

    nice tutorial

  • @ReelSkilla
    @ReelSkilla 4 роки тому +1

    Can I user mysql db for this?

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      Jeremaine, YES. the only thing that you will need to change is the provider in that case.
      You can follow this article -
      dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core-scaffold-example.html

  • @akshayparashar2348
    @akshayparashar2348 4 роки тому

    hey can u pls tell me how to update generated models from scaffolding?

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Hello Akshay, I am explaining that in the next episode of the series.

  • @peymanx
    @peymanx 4 роки тому

    has anyone encounter this error: System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'
    ??

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      What version of VS are you using and do you have .NET core installed on your machine?

    • @peymanx
      @peymanx 4 роки тому

      @@CuriousDrive Thanks for your response, It was about 'Platform Target', I changed it from 'Any CPU' to 'x86' and it runs perfectly,.now. ❤

  • @enriqueruiz320
    @enriqueruiz320 4 роки тому +1

    Excelente

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Thanks Enrique. Please share with others :)

  • @Jiz39
    @Jiz39 4 роки тому

    this explanation really helps me..thank you !
    could you please explain web api using 3 layered architecture and MVC together.

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      I am glad that it was helpful. your suggestion sounds like whole another series that I should work on.

    • @Jiz39
      @Jiz39 4 роки тому

      @@CuriousDrive Thank you..! Im looking forward to it.
      But in that there wont be any view or presentation layer. it wud be API. In Api -Controller ,Business Layer -Model .then Data Access Layer where database connections and queries are written. Applying dependency injection.
      Without Entity Framework .only asp .net core + Web Api. using stored procedures in sql server .performing CRUD operation with a siple example so that beginners like me could easily understnd. thank you Again.

    • @Jiz39
      @Jiz39 4 роки тому

      @@CuriousDrivelike Controller and Interface (Repository /Service Pattern) |using ASP.NET Core Web API performing Basic CRUD operation

  • @LuigiZambetti
    @LuigiZambetti 5 років тому +1

    Hello, could you suggest me the best book on EF Core and Web API Core? Maybe one that you have used to in the past.

    • @CuriousDrive
      @CuriousDrive  5 років тому +1

      Hey Luigi, I personally read either from microsoft docs - docs.microsoft.com/en-us/ef/core/
      or this website has very organized information about EF in general - www.entityframeworktutorial.net/what-is-entityframework.aspx
      I see what you are saying though, I miss reading books too. These frameworks are updated every quarter, I don't think any book will be good as it will be outdated pretty soon.
      microsoft docs does give you an option to download PDF on left bottom corner though. Something to read on the train ride :)

  • @AbdulRafay-wy3ve
    @AbdulRafay-wy3ve 2 роки тому

    anyone help me how to import giving database into my database??

  • @alirezanikravesh1763
    @alirezanikravesh1763 3 роки тому +1

    Thank you for this video.
    It's very useful.
    How to set database user name and password on connection string?

    • @CuriousDrive
      @CuriousDrive  3 роки тому

      Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;

  • @RaviKumar-yj7hu
    @RaviKumar-yj7hu 4 роки тому +1

    Can yo do video on .net core identity using db first approach like without migrations

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      Thanks for the suggestion Ravi. I do have 2 more videos left in this series. that could be one of them. Thanks!!!

    • @RaviKumar-yj7hu
      @RaviKumar-yj7hu 4 роки тому

      @@CuriousDrive I am eagerly waiting thank you

    • @RaviKumar-yj7hu
      @RaviKumar-yj7hu 4 роки тому

      @@CuriousDrive After the identity complete, register one user with postman or anything.

  • @samreenfarooq8274
    @samreenfarooq8274 2 роки тому

    I had to add "TrustServerCertificate=True" in connection string as well
    otherwise it wasn't running

  • @thanhatle7257
    @thanhatle7257 3 роки тому +1

    All are good, but I think u need to talk loudly and clearly, cuz I did had my volume up to 80 to watch the video >v

    • @CuriousDrive
      @CuriousDrive  3 роки тому +1

      I know. Other people complained about that too. I did not have a good microphone and no video editing skills. The new videos are better. Thanks for watching this one :)

  • @michaelfriebel3400
    @michaelfriebel3400 4 роки тому

    Thanks

  • @sasularaghavendra2250
    @sasularaghavendra2250 4 роки тому

    Could you please explain one example, How to use stored procedures in webAPI with entity framework
    Thanks,
    Raghavendra

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Hello Raghavendra, I have plans to make a video series on ASP.NET Web API for .NET 5 framework. I am going to cover how you can call stored procedure in that series but meanwhile you can take a look at this article. I hope this helps.
      www.entityframeworktutorial.net/efcore/working-with-stored-procedure-in-ef-core.aspx

  • @sreenuksr
    @sreenuksr 4 роки тому

    Nice video. Could you please share the code link. thank you!

    • @CuriousDrive
      @CuriousDrive  4 роки тому +1

      Hello Sreenivasa, you can find the code here - github.com/CuriousDrive/BookStores
      Thanks for watching. Please share with others

    • @sreenuksr
      @sreenuksr 4 роки тому

      @@CuriousDrive thank you

  • @jackbeyant9116
    @jackbeyant9116 4 роки тому

    Could you provide me database sql file? thanks a lot!

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      There you go - github.com/CuriousDrive/BookStores/blob/master/BookStoresWebAPI/Database/Backups/BookStoresDB.sql

  • @timesofvasanth5508
    @timesofvasanth5508 4 роки тому

    could you pls share the source code

    • @CuriousDrive
      @CuriousDrive  4 роки тому

      Yes. Vassanth, the code is at - github.com/CuriousDrive/BookStores
      Let me know if you run into any issues.

  • @microsoftsimba6990
    @microsoftsimba6990 2 роки тому +1

    You are Way Ahead from Begineer Perspective

    • @CuriousDrive
      @CuriousDrive  2 роки тому

      Sorry about that. The beginner videos are coming on the channel this year.