Это видео недоступно.
Сожалеем об этом.
Using Stored Procedures with Entity Framework 6 CORRECTLY In .Net 6
HTML-код
- Опубликовано: 13 авг 2024
- Stored Procedures with Entity Framework 6
Stored Procedures are a powerful way of querying databases in sql. It allows you to offload a lot to be handled by only the database as well as allowing you to have a piece of reusable sql code. So naturally being able to harness Stored procedures in a dotnet application would be nice to have, enter Entity Framework 6. It allows you multiple ways to call a Stored Procedure so I want to go over if Stored Procedures are better than using LINQ queries. Also, what are the limitations of EF6, or what would be easier done with another way of querying or using another library to call the stored procedures.
Microsoft Documentation: learn.microsoft.com/en-us/ef/...
Support Me On Patreon: / israelquiroz
Follow Me On TikTok: www.tiktok.com/@israelquiroz9...
All My Links Here: linktr.ee/israelquiroz
#StoredProcedureswithEntityFramework6 #storedprocedure #StoredProceduresDotnet6
TimeStamps
----------------------------
00:00 Intro
00:44 What Are Stored Procedures?
01:08 Why Use Stored Procedures Instead Of LINQ?
01:41 Limitations Of Entity Framework 6 When Using SQL Strings
03:50 Introducing The API We Are Using
04:23 Introducing The Database We Will Be Using
04:57 Creating The Repository Pattern For Calling The Stored Procedures
08:21 GetPlayer Stored Procedure Call Using EF6
13:18 GetPlayerList Stored Procedure Call Using EF6
14:37 CreatePlayer Stored Procedure Call Using EF6
17:53 UpdatePlayer Stored Procedure Call Using EF6
20:11 The BIGGEST ISSUE I Have With EF6 Calling Stored Procedures
So Stored Procedures Or LINQ?
Do you have a video about displaying the results on a razor page? I've been able to display SP results in a data grid that do not take parameters, but I am struggling to display results based on input, like with your GetPlayer(name, jersey). Thanks for the videos!
@@yogifoot np I appreciate the love and I don't have one but it's in the pipeline
Thanks for the tutorial, this what I needed. Regarding to answer your question above, I would say it depends on how complex how do you gather the data, sometimes we have a very complex query that has to be placed in stored procedure, that even inside that store procedure it called a SQL Functions, etc.
Back to the limitation, when it comes to loading multiple tables. You can create a new class that represents a row of data returned, then act on that as you would with other tables using stored procedure.
That's a good solution!!!! Thank u 😊
@@IsraelQuirozI had just this situation the other day until I found on Google someone saying you need to create a class with the columns. Once I did that, I was able to query the data because I could not use a Linq query due to the Over clause in my stored procedure. Otherwise, all my linq queries with multiple tables are used to create a new class and return that to the front end. Thanks for your video.
I really enjoyed watching your video, I was breaking my head to use joins and this video explained, Exactly what I wanted to hear!!
Your welcome!!! :)
Go ahead and use Dapper or Ado .Net for stored procedures from multiple tables!
I'm working on a Dapper video right now
This is an amazing video. I totally loved it! There is so much confusion around this topic, especially on SO. Seems like MS does not want developers to use a database-efficient approach nowadays. I still prefer designing my database first using Stored Procedures, functions, and many other T-SQL's PL-SQL blocks components.
Thank you! i really appreciate the kind words :)
I really appreciate what you did here! It is very useful to me, a Dot Net beginner.
Awesome! :) im happy u loved it hope to see u on the channel again
But won't the code scanner flag that as sql injection because your concatenating a string?
I'm Getting the Transfer-Encoding chunked error, can anyone know how to solve it?
Awesome video, hard to find people that speak clearly .... one option I do see in other videos is to use SqlDataReader , maybe do a video explaining how to use that as an option
thank u! :) i try and do my best to be clear, professional, and to the point!
ill keep that in mind thank u for the suggestion!
Subscribed. Great Lesson!!
Thank you!!!! happy to hear u loved it! appreciate the support!
IS Full Stack Dot Net Developer with Angular a good career choice?
.Net is not going anywhere any time soon Microsoft
And Angular is getting super pushed and is getting awesome updates from Google
So both technologies aren't going anywhere and it's what I do currently professionally I think they are both very modern technologies
@@IsraelQuiroz Really thanks for replying..😊
configuration or codes in SampleDatabaseContext not showing in the video.
i show you what my database looks like, just scaffold you database to create your context and models using EF
Por favor puedes mostrarme la configuracion de DataBase, la usas en el insert.
ensene mi db como al minuto 4 o que mas necesitas?
It is too bad we cannot call stored procedure that produce query of joined table, is it happened you already figure out the way?
yeah it's really frustrating, i just use other packages for doing that, i don't think ER7 fixed that either
Please upload a video to call stored procedure that produces query of joined table.
made a note of it :)
bro can you make a video on how to call stored procedures from mysql and efcore 7 web api
Thank you for the comment, i dont believe much if anything has changed with how u call stored procedures from EF6 to EF7 they only made some changes with how i think the tables are mapped in EF7 but thats all
So why you using interface?
I mean what benefits
I highly recommend for you to look into composition.
watch my Repository Pattern video :)
interface give you the ability to change the service more easy without deal with the classes who use the "service".
lets say you got the Players list from sql and after a while you want to get them from Elastic search so the only change you need to do is to change in "addScope" (and write the service of course)
It's really cool bro.
But why you call it Soccer, it's Football....
Haha habit 😅