如何在EF的另一个存储过程中包装存储过程?

时间:2022-04-28 02:38:10

I have a stored procedure in my database that I'm calling through EF. This is the line of code that I'm using to call it:

我在我的数据库中有一个存储过程,我通过EF调用。这是我用来调用它的代码行:

modelBuilder.Entity<User>()
            .MapToStoredProcedures(u => u.Delete(t => t.HasName("UserDelete")
                                         .Parameter(b => b.ID, "@UserId")));

I see EF wrapping this into a stored procedure of its own, so it's turning out to be a stored procedure running within another stored procedure that was created by EF. Is there a way to make EF NOT create a stored procedure for hitting the one that's in the database?

我看到EF将它包装到它自己的存储过程中,因此它变成了一个在EF创建的另一个存储过程中运行的存储过程。有没有办法让EF NOT创建一个存储过程来命中数据库中的那个?

1 个解决方案

#1


0  

EF uses the recommended way of executing your stored procedure. Most probably, you don't need to alter this behavior. Please see here for more information.

EF使用推荐的方式执行存储过程。最有可能的是,您不需要改变这种行为。请在此处查看更多信息。

#1


0  

EF uses the recommended way of executing your stored procedure. Most probably, you don't need to alter this behavior. Please see here for more information.

EF使用推荐的方式执行存储过程。最有可能的是,您不需要改变这种行为。请在此处查看更多信息。