How to call a stored procedure in EF Core 3.0 via FromSqlRaw

后端 未结 6 1140
失恋的感觉
失恋的感觉 2020-12-03 14:04

I recently migrated from EF Core 2.2 to EF Core 3.0.

Unfortunately, I haven\'t found a way to call a stored procedure that returns an entity.

In EF Core 2.

6条回答
  •  情歌与酒
    2020-12-03 14:34

    Solution (thanks to David Browne, you should have posted it as an answer):

    Replacing Single with ToList works :-)

    var createdPath = ModelContext.Paths.FromSqlRaw("AddNodeWithPathProc  {0}, {1}", nodeTitle, parentPathString).ToList();
    

提交回复
热议问题