Using stored procedure in entity framework core

preview_player
Показать описание
How to use stored procedures with entity framework core.

EF Core FromSqlRaw Method

FromSqlRaw() is one of the methods we can use to execute stored procedures from entity framework core. This method is also useful if the query can't be expressed using LINQ or when LINQ is not able to generate efficient SQL query.

Text version of the video

Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.

Slides

ASP.NET Core Razor Pages Text Articles & Slides

ASP.NET Core Razor Pages Tutorial

Angular, JavaScript, jQuery, Dot Net & SQL Playlists

Let's gift education together
Рекомендации по теме
Комментарии
Автор

Amazing video, I am kinda scared of using EF core, i hear its a noob trap even though its an amazing tool. Its easy to use when it works but when it breaks or slows down hard to fix. I hope you continue to make in-depth EF core vids so that the people have more control over what EF core dose and doesn't auto generate someone straight to debug hell. Thx again @
kudvenkat i am gonna go and make some stored procedures now :D

martink
Автор

I'm so happy. In my work we only use stored procedures. Thank you very much Venkat . 👍👍👍👍👍

coolwaterdvr
Автор

Worth noting, that it's better to select P type object from sysobjects with the procedure name to avoid conflicts if for some reason you create procedure with database-first approach and forgot to drop it to make the migration actually drop it when already exists.

IF (OBJECT_ID('spGetEmployeeById', 'P') IS NOT NULL)
DROP PROCEDURE spGetEmployeeById
GO

xmesaj
Автор

You make everything simple and to the point.Thank you.

abeldaniel
Автор

Very nice. Did something rather similar. When you have a sp for a join query then I make another model class that represents this join. So, I actually end up with a lot of model classes just to match the results of the stored procedure. So far didn't know a better way. Any suggestions?

ernstpeterlegrand
Автор

what if I have a pretty much expensive sp query? I should set it to a string variable as well?

AlishSafarli
Автор

what if my store procedure contains joins? In this video, we are executing stores procedure inside Employees Table. How we will execute a store procedure which is fetching data from two joined tables?

zeeshanahmadkhalil
Автор

your tutorials are amazing always.

but in ur video..i dint found what i want... i thought i would get a good explanation about CRUD Operations using Stored Procedure in Sql Server. ASP.Net Core Web Api Without Entity Framework but Using 3 layered Architecture .(without Presentation Layer) Applies Dependency Injection.

Thank You!

Jiz
Автор

My tutors told two things which are not matching with this video:-
First : Stored Procs can't do SELECT operations
Second: In EF Core, we use ExecuteSqlRaw to implement stored proc

dempseyroll
Автор

Why does EF core require you to use context.Employees? If you had 2nd table, say Customers, could you use {}", id) instead of {}", id)?

It seems to me that the stored procedure is independent of the table name. In this case, I see it's related but how would EF core know this ?

fitpacking
Автор

What if you already have an existing stored procedure in the database. Do you still need to migrate it and go through the whole thing?

NeonEnigmaJC
Автор

That's insane how SPs are called in code first, we have to hard code its name and remember parameter positions which is error prone. I am big fan of how sps are called as methods with intellisence support in database approaches. Hate few things of Microsoft the way they do those.

microtech
Автор

Why did you create a procedure while you can access the same result easily with the help of EF core
Can you show the same thing with multiple table columns selection???

karvan
Автор

HI, how to return multiple result set from stored procedures with entity framework core

AshishSingh
Автор

Thank You sir. Would you please give me an example dbfirst approach and is there any code in how we can make only a method for calling all the store procedure with various types of parameters.

ranasohel
Автор

Hello sir, I am struggling a bit about how to use crud stored procedure in entity framework core for legacy applications (database first approch).

manipathak
Автор

Is it possible to makevideo on postgres server and make calls to stored procedures with code first approach

deepakampli
Автор

Thank you Sir.I am having error while executing stored procedure with output parameters in oracle database. please give me some solution sir.

aaryandangol