gpt4 book ai didi

asp.net-core - 如何在 Entity Framework Core 中运行存储过程?

转载 作者:行者123 更新时间:2023-12-02 00:27:24 24 4
gpt4 key购买 nike

我在 ASP.NET Core 应用程序中使用 EF Core 1.0。你能指出我执行存储过程的正确方法吗?旧方法 ObjectParameters((IObjectContextAdapter)this).ObjectContext.ExecuteFunction不工作。

最佳答案

现在解决了 EF Core 1.0 中对存储过程的支持,这也支持多个结果集的映射。
Check here for the fix details
你可以在 c# 中这样称呼它

var userType = dbContext.Set().FromSql("dbo.SomeSproc @Id = {0}, @Name = {1}", 45, "Ada");

关于asp.net-core - 如何在 Entity Framework Core 中运行存储过程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28599404/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com