Call Oracle Stored Procedure / Map to Class
Posted: Thu 15 Dec 2016 11:36
Hello,
is it possible to call an Oracle stored procedure using DotConnect and EfCore 1.1 or EF6? How?
(EF6 and Core are both configured with Fluent Api))
I would like to have an opportunity to do so just like you can do it using Microsoft database and EfProvider. Particularly I would like to map the results to the same class (in this sample TestNstrIdInstId)
(The sample code is using EfCore)
using (var sut = CreateContext(connectionString, dbType, efVersion))
{
var userType = sut.Set<TestNstrIdInstId>().FromSql("[icsys].[SP_InstNstrIds] {0}", "104,2447,2316").ToList();
public class TestNstrIdInstId
{
public decimal InstId { get; set; }
[Key]
public decimal NstrId { get; set; }
}
CREATE procedure icsys.SP_PersNstrIds (@P_NSTRIDs varchar(8000)) As ….
I’m currently using DotConnect Pro 9.2.162.
The solution should enable to use both a MSSQL or an Oracle Database, e.g. the entities, the results are mapped to, should be Independent from the way the call to DBContext is made. Different calls to the context would be okay.
I couldn’t find any suitable description yet.
Thank you
Thomas.
is it possible to call an Oracle stored procedure using DotConnect and EfCore 1.1 or EF6? How?
(EF6 and Core are both configured with Fluent Api))
I would like to have an opportunity to do so just like you can do it using Microsoft database and EfProvider. Particularly I would like to map the results to the same class (in this sample TestNstrIdInstId)
(The sample code is using EfCore)
using (var sut = CreateContext(connectionString, dbType, efVersion))
{
var userType = sut.Set<TestNstrIdInstId>().FromSql("[icsys].[SP_InstNstrIds] {0}", "104,2447,2316").ToList();
public class TestNstrIdInstId
{
public decimal InstId { get; set; }
[Key]
public decimal NstrId { get; set; }
}
CREATE procedure icsys.SP_PersNstrIds (@P_NSTRIDs varchar(8000)) As ….
I’m currently using DotConnect Pro 9.2.162.
The solution should enable to use both a MSSQL or an Oracle Database, e.g. the entities, the results are mapped to, should be Independent from the way the call to DBContext is made. Different calls to the context would be okay.
I couldn’t find any suitable description yet.
Thank you
Thomas.