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

  Рет қаралды 246,431

CuriousDrive: Solve Coding Problems & Win Prizes!

CuriousDrive: Solve Coding Problems & Win Prizes!

Күн бұрын

Пікірлер: 249
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Code - github.com/CuriousDrive/BookStores Thanks for watching, please share with your friends :)
@waqasriaz30
@waqasriaz30 3 жыл бұрын
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 жыл бұрын
@@CuriousDrive thanks. It worked like a charm.
@taha5871
@taha5871 2 жыл бұрын
Prefer to put file .bat and we just import it.
@Lolatyou332
@Lolatyou332 5 жыл бұрын
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 жыл бұрын
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 3 ай бұрын
@@CuriousDrive you are so nice person thanks for to kind behaviour Allah always bless you.
@svantepanter
@svantepanter 4 жыл бұрын
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 жыл бұрын
Yes the idea was to get people started with entity framework instead scaring them. Thanks for a lovely comment 😊
@waqasriaz30
@waqasriaz30 3 жыл бұрын
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.
@paul46722
@paul46722 4 жыл бұрын
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.
@simonroyjonesuk
@simonroyjonesuk 3 жыл бұрын
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. kzbin.info/www/bejne/eqC8nqN3hdScrqs
@kumaresanettiyannan6453
@kumaresanettiyannan6453 4 жыл бұрын
Awesome tutorial.. crisp and clear information. thank you.
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for watching Kumaresan, Please share with your friends :)
@thainguyenphuong9154
@thainguyenphuong9154 3 жыл бұрын
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 :)
@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.
@WikkiOnIlluminati
@WikkiOnIlluminati 4 жыл бұрын
Awesome video series. Best and quick learning. thanks
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for watching Wikki. and thanks for a lovely comment.
@ramarch0803
@ramarch0803 4 жыл бұрын
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 :)
@arifjaved592
@arifjaved592 4 жыл бұрын
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 жыл бұрын
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 -> kzbin.info/www/bejne/j6bGf2qHqsR_etU and you can find the whole series here -> kzbin.info/aero/PL4WEkbdagHIQVbiTwos0E38VghMJA06OT
@arifjaved592
@arifjaved592 4 жыл бұрын
@@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.
@leratomphahlele1908
@leratomphahlele1908 3 жыл бұрын
Best series I found on the topic
@CuriousDrive
@CuriousDrive 3 жыл бұрын
Thanks for a lovely comment lerato :)
@pw.70
@pw.70 4 жыл бұрын
Simple and concise - thank-you.
@CuriousDrive
@CuriousDrive 3 жыл бұрын
Thanks for a lovely comment P W. I am glad you found the video helpful
@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.
@stoic2454
@stoic2454 4 жыл бұрын
This is awesome, loved your vdo, easy to understand, to the point, thank you so much.
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for watching himanshu
@yigitcankeskin8659
@yigitcankeskin8659 2 жыл бұрын
so good video , THANK SO MUCH.
@CuriousDrive
@CuriousDrive 2 жыл бұрын
Thanks for watching yiğitcan keskin!!!
@ahmetselcukzengin7664
@ahmetselcukzengin7664 2 жыл бұрын
Thanks a lot , great tutorial and reminder (:
@CuriousDrive
@CuriousDrive 2 жыл бұрын
Thanks for watching Ahmet.
@alfonsovillegas489
@alfonsovillegas489 5 жыл бұрын
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 жыл бұрын
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 жыл бұрын
Curious Drive That’s amazing, will keep in touch, subscribed!
@guillermoruiz3568
@guillermoruiz3568 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 жыл бұрын
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 :)
@josephdsilva4941
@josephdsilva4941 2 жыл бұрын
Very Useful Content, Thanks a lot...
@greendeer2437
@greendeer2437 3 жыл бұрын
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
@Vitoman123
@Vitoman123 3 жыл бұрын
Thank you. Very good tutorial
@CuriousDrive
@CuriousDrive 3 жыл бұрын
Thanks for watching Viktor. Please share with frandzzz :)
@theachyller69
@theachyller69 4 жыл бұрын
You're saving my live!!!!! thanks man
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for watching Tang. Let me know if you run into any issues :)
@shaikhakhtar3857
@shaikhakhtar3857 5 жыл бұрын
Really nice video, Please make videos on step by step project implemention too
@CuriousDrive
@CuriousDrive 5 жыл бұрын
Hi Akhtar, I am not sure if I am following your feedback. Can you please elaborate?
@cwmizner
@cwmizner Жыл бұрын
Outstanding, thank you!
@BudiSantoso-er6cq
@BudiSantoso-er6cq 4 жыл бұрын
Great tutorial, thanks very much bro..
@emilgabrielharabagiu898
@emilgabrielharabagiu898 4 жыл бұрын
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 жыл бұрын
Nvm, i got it!
@CuriousDrive
@CuriousDrive 4 жыл бұрын
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.
@Artavazd.kirakosyan
@Artavazd.kirakosyan 4 жыл бұрын
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 жыл бұрын
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.
@Mimsy124
@Mimsy124 4 жыл бұрын
The luckiest number ever :) Nice video , thanks a lot
@CuriousDrive
@CuriousDrive 4 жыл бұрын
It's fun making these demos. Thanks for watching :)
@IPanonima17
@IPanonima17 4 жыл бұрын
you have saved my semester, thanks a lot
@CuriousDrive
@CuriousDrive 4 жыл бұрын
You made my day!!!
@athiraramachandranl1605
@athiraramachandranl1605 3 жыл бұрын
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.
@mithileshpandey9885
@mithileshpandey9885 3 жыл бұрын
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
@Artavazd.kirakosyan
@Artavazd.kirakosyan 4 жыл бұрын
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 жыл бұрын
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.
@ersingencer80
@ersingencer80 2 жыл бұрын
so simple and great tutorial thank you so much
@natep7425
@natep7425 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 жыл бұрын
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
@nehagarg9091
@nehagarg9091 4 жыл бұрын
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?
@gokul4060
@gokul4060 4 жыл бұрын
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 :)
@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...
@rp4361
@rp4361 2 жыл бұрын
For all who are facing issues with scaffolding-dbcontext. Below is the updated command - dotnet ef dbcontext scaffold "Your conn string" Microsoft.EntityFrameworkCore.SqlServer -o Models Basically the command has been changed in later versions.
@talkathiriify
@talkathiriify 5 жыл бұрын
Amazing Thank you very much.
@selvakumarv1341
@selvakumarv1341 3 жыл бұрын
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 😊
@auchucknorris
@auchucknorris 3 жыл бұрын
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
@phongvu2431
@phongvu2431 3 жыл бұрын
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
@KearlHat
@KearlHat 3 жыл бұрын
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. kzbin.info/www/bejne/j6bGf2qHqsR_etU
@mememonster2370
@mememonster2370 3 жыл бұрын
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
@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
@yudaguntoro9327
@yudaguntoro9327 2 жыл бұрын
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. kzbin.info/www/bejne/mGHZZZKBq5mSiKM
@AMIRKHAN-dm2fm
@AMIRKHAN-dm2fm 4 жыл бұрын
Thanks but I have question? How we can create multiple Get Methods in a same Controller with different method names.?
@CuriousDrive
@CuriousDrive 4 жыл бұрын
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.
@anbhuonline
@anbhuonline Жыл бұрын
am i the one not able to find the .bak file in the said git link?
@kandinagireddy
@kandinagireddy Жыл бұрын
Tutorial is very good. Are there any new series on .Net 6/7/8/ Web api??
@toddcagelives
@toddcagelives 3 жыл бұрын
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.
@mp-ot7fw
@mp-ot7fw 4 жыл бұрын
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 жыл бұрын
It's json formatter chrome extension. 😊
@mp-ot7fw
@mp-ot7fw 4 жыл бұрын
@@CuriousDrive Thanks that worked!
@moliv8927
@moliv8927 4 жыл бұрын
Amazing video!
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for watching 😊
@whooomzoilo4833
@whooomzoilo4833 3 жыл бұрын
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. kzbin.info/www/bejne/j6bGf2qHqsR_etU
@janmarcinkowski7184
@janmarcinkowski7184 3 жыл бұрын
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
@amnesia3490
@amnesia3490 3 жыл бұрын
How can I add Identity for existing database ?
@CuriousDrive
@CuriousDrive 3 жыл бұрын
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.
@ioanabondoc3844
@ioanabondoc3844 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
Ohh okay. Let me know if you run into any issues. Here to help!!!
@rajasekharareddy7117
@rajasekharareddy7117 3 жыл бұрын
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
@imran2march
@imran2march 5 жыл бұрын
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 жыл бұрын
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.
@flaviusioan69
@flaviusioan69 4 жыл бұрын
Thnx for this easy tut...
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for watching Ioan. Please subscribe and share with your friends
@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?
@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!
@kandinagireddy
@kandinagireddy Жыл бұрын
Hi , Is there any update from your channel?
@ganesans5641
@ganesans5641 2 жыл бұрын
good work and thanx
@chrispotvin5977
@chrispotvin5977 5 жыл бұрын
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 жыл бұрын
@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!!!
@fifigame6089
@fifigame6089 3 жыл бұрын
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.
@chaabanitasnim9376
@chaabanitasnim9376 4 жыл бұрын
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
@softwareenthusiasm3667
@softwareenthusiasm3667 2 жыл бұрын
Instead of adding ,update Author in same [HttpGet] which is not recommended, there are many http method can handle CRUD functionalities.
@Artavazd.kirakosyan
@Artavazd.kirakosyan 4 жыл бұрын
thanks for the video, trying to import the databas.bak file, but failed, any tips or advise?
@CuriousDrive
@CuriousDrive 4 жыл бұрын
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),....
@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)
@danhnguyenthanh8849
@danhnguyenthanh8849 2 жыл бұрын
Great video
@cessargraux
@cessargraux 4 жыл бұрын
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
@anirudhsingh8619
@anirudhsingh8619 3 жыл бұрын
nice tutorial
@CuriousDrive
@CuriousDrive 3 жыл бұрын
Thanks for watching Anirudh :)
@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 - kzbin.info/www/bejne/bZKaq4yFibmLiNU
@sabarinathkr7603
@sabarinathkr7603 4 жыл бұрын
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
@enriqueruiz320
@enriqueruiz320 4 жыл бұрын
Excelente
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks Enrique. Please share with others :)
@mithileshpandey9885
@mithileshpandey9885 4 жыл бұрын
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.
@jomarsalazar2572
@jomarsalazar2572 4 жыл бұрын
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
@charlesm.1638
@charlesm.1638 4 жыл бұрын
What about getting the record based on the id entered into the get?
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Hey Charelse, I covered that part in below demo. kzbin.info/www/bejne/q4GtY2BsjrWFoK8 Let me know if you have questions related to that video.
@charlesm.1638
@charlesm.1638 4 жыл бұрын
@@CuriousDrive Thank you.
@nadaraialuka
@nadaraialuka 3 жыл бұрын
Luv you maaaan
@CuriousDrive
@CuriousDrive 3 жыл бұрын
Love you too bruh!! Thanks for watching. Please share with your friends :)
@thyeaa
@thyeaa 5 жыл бұрын
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
@sujashreemurugesh9106
@sujashreemurugesh9106 4 жыл бұрын
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
@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
@doncharly7723
@doncharly7723 4 жыл бұрын
Is it possible for you to increase the sound and upload the files? This sound is very feeble. Video looks great.
@CuriousDrive
@CuriousDrive 4 жыл бұрын
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!
@klsonic
@klsonic 4 жыл бұрын
Is the web api you've created a rest api?
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Yes. You are correct.
@alirezanikravesh1763
@alirezanikravesh1763 3 жыл бұрын
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;
@ReelSkilla
@ReelSkilla 4 жыл бұрын
Can I user mysql db for this?
@CuriousDrive
@CuriousDrive 4 жыл бұрын
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
@samreenfarooq8274
@samreenfarooq8274 2 жыл бұрын
I had to add "TrustServerCertificate=True" in connection string as well otherwise it wasn't running
@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.
@thanhatle7257
@thanhatle7257 3 жыл бұрын
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 жыл бұрын
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 :)
@AbdulRafay-wy3ve
@AbdulRafay-wy3ve 2 жыл бұрын
anyone help me how to import giving database into my database??
@LuigiZambetti
@LuigiZambetti 5 жыл бұрын
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 жыл бұрын
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 :)
@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. ❤
@RaviKumar-yj7hu
@RaviKumar-yj7hu 4 жыл бұрын
Can yo do video on .net core identity using db first approach like without migrations
@CuriousDrive
@CuriousDrive 4 жыл бұрын
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.
@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 жыл бұрын
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
@michaelfriebel3400
@michaelfriebel3400 4 жыл бұрын
Thanks
@CuriousDrive
@CuriousDrive 4 жыл бұрын
Thanks for watching Michael.
@microsoftsimba6990
@microsoftsimba6990 3 жыл бұрын
You are Way Ahead from Begineer Perspective
@CuriousDrive
@CuriousDrive 2 жыл бұрын
Sorry about that. The beginner videos are coming on the channel this year.
@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
ASP.NET Core Web API + Entity Framework Core : Scaffold-DbContext - EP02
9:21
CuriousDrive: Solve Coding Problems & Win Prizes!
Рет қаралды 75 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
I just tried o3-mini
6:31
ThePrimeTime
Рет қаралды 227 М.
ASP.NET Core Crash Course - C# App in One Hour
1:00:44
freeCodeCamp.org
Рет қаралды 1,6 МЛН
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 227 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН