简体   繁体   English

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

[英]How to NOT wrap stored procedure within another stored procedure for EF?

I have a stored procedure in my database that I'm calling through EF. 我的数据库中有一个通过EF调用的存储过程。 This is the line of code that I'm using to call it: 这是我用来调用它的代码行:

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. 我看到EF将其包装到它自己的存储过程中,因此事实证明它是在EF创建的另一个存储过程中运行的存储过程。 Is there a way to make EF NOT create a stored procedure for hitting the one that's in the database? 有没有一种方法可以使EF NOT不创建存储过程来访问数据库中的存储过程?

EF uses the recommended way of executing your stored procedure. EF使用推荐的方式执行存储过程。 Most probably, you don't need to alter this behavior. 最有可能的是,您不需要更改此行为。 Please see here for more information. 在此处查看更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM