如何在.NET 5 Web API中执行EF Core 5中的存储过程?

发布于 2025-02-11 05:34:01 字数 402 浏览 3 评论 0原文

我在SQL Server中有一个存储过程,我试图用下面所示的屏幕截图中的代码执行。此存储过程正在返回一些原始JSON,而不是任何对象或实体。

我在Google上发现我们可以使用fromsqlraw函数进行操作,但是我根本没有在Intellisense中获得该功能。有人可以告诉我如何使用.NET 5中的EF Core 5执行它吗?我只想执行它并将其结果存储在变量中。

这是我的代码:

“在此处输入图像描述”

I have a stored procedure in SQL Server which I am trying to execute with code as attached in the screenshot shown below. This stored procedure is returning some raw json, not any object or entity.

I found on Google that we can do it using the FromSqlRaw function, but I am not getting that function at all in Intellisense. Can someone please tell me how I can execute it using EF Core 5 in .NET 5? I just want to execute it and store its result in a variable.

This is my code:

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文