如何使用Select语句在存储过程上使用LINQ?

时间:2022-04-26 22:00:30

How do I use LINQ on a stored procedure with a Select statement?

如何使用Select语句在存储过程上使用LINQ?

I know how can I use stored procedure to execute some procedure for me, however, if I want to return some data from a stored procedure? How do I do that?

我知道如何使用存储过程为我执行某些过程,但是,如果我想从存储过程返回一些数据?我怎么做?

Regards

1 个解决方案

#1


Scott Guthrie has a fairly detailed blog post about this. Normally I believe you'd call a stored procedure as a separate method - if you want to include it in a select clause, you should probably use a user-defined function (UDF) instead. These are covered in the same blog post.

斯科特格思里有一个相当详细的博客文章。通常我相信您将存储过程称为单独的方法 - 如果要将其包含在select子句中,则应该使用用户定义的函数(UDF)。这些内容在同一篇博客文章中介绍。

If you've already read this and it doesn't help, could you give details of which part isn't working for you?

如果您已经阅读过此内容并没有帮助,您是否可以详细说明哪部分不适合您?

#1


Scott Guthrie has a fairly detailed blog post about this. Normally I believe you'd call a stored procedure as a separate method - if you want to include it in a select clause, you should probably use a user-defined function (UDF) instead. These are covered in the same blog post.

斯科特格思里有一个相当详细的博客文章。通常我相信您将存储过程称为单独的方法 - 如果要将其包含在select子句中,则应该使用用户定义的函数(UDF)。这些内容在同一篇博客文章中介绍。

If you've already read this and it doesn't help, could you give details of which part isn't working for you?

如果您已经阅读过此内容并没有帮助,您是否可以详细说明哪部分不适合您?