Stored Procedure Returns Multiple Reference Cursors

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
greyfox55
Posts: 3
Joined: Thu 24 Mar 2016 20:55

Stored Procedure Returns Multiple Reference Cursors

Post by greyfox55 » Tue 19 Apr 2016 21:51

I have a stored procedure that returns 3 ref cursors. I am using PostgreSQL 9.5 with dotConnect for Postgres. I am trying to integrate the stored procedures / functions into the entity framework but whenever I try to create a method for the stored procedure I get the following error.

"Cannot create method for a storage function 'getpatientshapedata' that can be composed. Only stored procedure may be mapped'

For reference this is my stored procedure.

Code: Select all

CREATE OR REPLACE FUNCTION public.getpatientshapedata(p_shape_id int8, p_shape_cursor refcursor, p_shape_file_cursor refcursor, p_shape_modification_cursor refcursor)
  RETURNS SETOF refcursor
AS
$BODY$
  DECLARE
    BEGIN

      OPEN p_shape_cursor FOR
        select * from patientshape where id = p_shape_id;
      RETURN NEXT p_shape_cursor;

      OPEN p_shape_file_cursor FOR
        select * from patientshapefile where patientshapeid = p_shape_id;
      RETURN NEXT p_shape_file_cursor;

      OPEN p_shape_modification_cursor FOR
        select * from patientshapemodification where patientshapeid = p_shape_id;
      RETURN NEXT p_shape_modification_cursor;

    END;
$BODY$
LANGUAGE plpgsql VOLATILE;
How can I create a method for calling this with the entity framework?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Stored Procedure Returns Multiple Reference Cursors

Post by Shalex » Fri 22 Apr 2016 15:39

Please follow this walkthrough:

1. Create test database objects

Code: Select all

CREATE TABLE DEPT (
  DEPTNO INT PRIMARY KEY,
  DNAME VARCHAR(14),
  LOC VARCHAR(13)
);

CREATE TABLE EMP (
  EMPNO INT PRIMARY KEY,
  ENAME VARCHAR(10),
  JOB VARCHAR(9),
  MGR INT,
  HIREDATE DATE,
  SAL REAL,
  COMM REAL,
  DEPTNO INT REFERENCES DEPT
);

INSERT INTO DEPT VALUES (10,'ACCOUNTING','NEW YORK');
INSERT INTO EMP VALUES
  (7782,'CLARK','MANAGER',7839,'1981-6-9',2450,NULL,10);
INSERT INTO EMP VALUES
  (7839,'KING','PRESIDENT',NULL,'1981-11-17',5000,NULL,10);

CREATE OR REPLACE FUNCTION getdeptemp()
	RETURNS SETOF refcursor AS
$BODY$
DECLARE
	dept_cursor refcursor;
	emp_cursor refcursor;
BEGIN
	OPEN dept_cursor FOR select * from dept;
	RETURN NEXT dept_cursor;

	OPEN emp_cursor FOR select * from emp;
	RETURN NEXT emp_cursor;
END;
$BODY$
	LANGUAGE plpgsql VOLATILE;
2. Run Create Model Wizard (*.edml) in your project and select the dept, emp tables and the getdeptemp function. Tables will be added to both SSDL and CSDL, the function will be available only in SSDL part of the model.

3. Open *.edml, navigate to Tools > Entity Developer > Model Explorer > Store > Stored Procedures, select getdeptemp and set its Concealed Function property to True. Now you can drag&drop getdeptemp on the diagram surface, press No in the "Do you wish to obtain metadata of procedure result set?" dialog. As a result, Getdeptemp will be available in CSDL.

4. Double click Getdeptemp in CSDL (the Methods node) to open Method Editor. In the Return Type section, select Value Types and set two lines:
Dept
Emp
Press OK, save the model to generate the code.

5. Now run the code:

Code: Select all

    using (var context = new MyEntities()) {
        var connection = (context.Connection as System.Data.Entity.Core.EntityClient.EntityConnection).StoreConnection;
        connection.Open();
        var transaction = connection.BeginTransaction();
        var result = context.Getdeptemp();
    }
JIC: you can avoid creating the getdeptemp function in the database. Instead of this, right click Stored Procedures in Model Explorer > Add > New Command Text with the following SQL Script:

Code: Select all

select * from dept;
select * from emp;
Now set Procedure1's Concealed Function property to True and use it like getdeptemp.

greyfox55
Posts: 3
Joined: Thu 24 Mar 2016 20:55

Re: Stored Procedure Returns Multiple Reference Cursors

Post by greyfox55 » Fri 22 Apr 2016 17:32

Okay so I have my stored procedure being added to the model, however now I am getting an error in the method it generated. It is complaining there is no definition for EntityKey, Attach, and ObjectStateManager. Basically it doesn't build. FYI I am using Entity Framework 6.1.

Code: Select all

/// <summary>
        /// There are no comments for getpatientshapedata in the schema.
        /// </summary>
        public virtual getpatientshapedataMultipleResult getpatientshapedata (global::System.Nullable<long> p_shape_id, byte[] p_shape_cursor, byte[] p_shape_file_cursor, byte[] p_shape_modification_cursor)
        {

            getpatientshapedataMultipleResult result = new getpatientshapedataMultipleResult();

            DbConnection connection = Database.Connection;
            bool needClose = false;
            if (connection.State != ConnectionState.Open) {
              connection.Open();
              needClose = true;
            }

            try {
              DbCommand cmd = connection.CreateCommand();
              if (((IObjectContextAdapter)this).ObjectContext.CommandTimeout.HasValue)
                cmd.CommandTimeout = ((IObjectContextAdapter)this).ObjectContext.CommandTimeout.Value;
              cmd.CommandType = CommandType.StoredProcedure;
              cmd.CommandText = @"public.getpatientshapedata";

              DbParameter p_shape_idParameter = cmd.CreateParameter();
              p_shape_idParameter.ParameterName = "p_shape_id";
              p_shape_idParameter.Direction = ParameterDirection.Input;
              p_shape_idParameter.Value = p_shape_id;
              cmd.Parameters.Add(p_shape_idParameter);

              DbParameter p_shape_cursorParameter = cmd.CreateParameter();
              p_shape_cursorParameter.ParameterName = "p_shape_cursor";
              p_shape_cursorParameter.Direction = ParameterDirection.Input;
              p_shape_cursorParameter.Value = p_shape_cursor;
              cmd.Parameters.Add(p_shape_cursorParameter);

              DbParameter p_shape_file_cursorParameter = cmd.CreateParameter();
              p_shape_file_cursorParameter.ParameterName = "p_shape_file_cursor";
              p_shape_file_cursorParameter.Direction = ParameterDirection.Input;
              p_shape_file_cursorParameter.Value = p_shape_file_cursor;
              cmd.Parameters.Add(p_shape_file_cursorParameter);

              DbParameter p_shape_modification_cursorParameter = cmd.CreateParameter();
              p_shape_modification_cursorParameter.ParameterName = "p_shape_modification_cursor";
              p_shape_modification_cursorParameter.Direction = ParameterDirection.Input;
              p_shape_modification_cursorParameter.Value = p_shape_modification_cursor;
              cmd.Parameters.Add(p_shape_modification_cursorParameter);

              using (IDataReader reader = cmd.ExecuteReader()) {
                while (reader.Read()) {

                  patientshape resultRow = new patientshape();
                  if (!reader.IsDBNull(reader.GetOrdinal("id")))
                    resultRow.id = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("id")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("patientid")))
                    resultRow.patientid = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("patientid")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("uniqueid")))
                    resultRow.uniqueid = (global::System.Guid)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("uniqueid")), typeof(global::System.Guid));

                  if (!reader.IsDBNull(reader.GetOrdinal("deletedflag")))
                    resultRow.deletedflag = (bool)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("deletedflag")), typeof(bool));

                  if (!reader.IsDBNull(reader.GetOrdinal("affectedareaid")))
                    resultRow.affectedareaid = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("affectedareaid")), typeof(string));

                  if (!reader.IsDBNull(reader.GetOrdinal("directionid")))
                    resultRow.directionid = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("directionid")), typeof(string));
                  else
                    resultRow.directionid = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("shapetypeid")))
                    resultRow.shapetypeid = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("shapetypeid")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("shapeinputmethodid")))
                    resultRow.shapeinputmethodid = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("shapeinputmethodid")), typeof(long));
                  else
                    resultRow.shapeinputmethodid = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("selectedmodpanelid")))
                    resultRow.selectedmodpanelid = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("selectedmodpanelid")), typeof(long));
                  else
                    resultRow.selectedmodpanelid = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("summary")))
                    resultRow.summary = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("summary")), typeof(string));
                  else
                    resultRow.summary = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("comments")))
                    resultRow.comments = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("comments")), typeof(string));
                  else
                    resultRow.comments = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("createdate")))
                    resultRow.createdate = (global::System.DateTime)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("createdate")), typeof(global::System.DateTime));

                  if (!reader.IsDBNull(reader.GetOrdinal("createdby")))
                    resultRow.createdby = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("createdby")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("lastupdated")))
                    resultRow.lastupdated = (global::System.DateTime)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("lastupdated")), typeof(global::System.DateTime));

                  if (!reader.IsDBNull(reader.GetOrdinal("lastupdatedby")))
                    resultRow.lastupdatedby = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("lastupdatedby")), typeof(long));

                  ObjectStateEntry entry;
                  resultRow.EntityKey = 
                  new EntityKey("OMEGAEntities.patientshapes", new KeyValuePair<string, object>[] { new KeyValuePair<string, object>("id", resultRow.id) }); 
          
                  if (this.ObjectStateManager.TryGetObjectStateEntry(resultRow.EntityKey, out entry))
                    resultRow = (patientshape)entry.Entity;
                  else
                    this.Attach(resultRow);

                  result.patientshapes.Add(resultRow);
                }

                reader.NextResult();

                while (reader.Read()) {

                  patientshapefile resultRow = new patientshapefile();
                  if (!reader.IsDBNull(reader.GetOrdinal("id")))
                    resultRow.id = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("id")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("patientshapeid")))
                    resultRow.patientshapeid = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("patientshapeid")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("uniqueid")))
                    resultRow.uniqueid = (global::System.Guid)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("uniqueid")), typeof(global::System.Guid));

                  if (!reader.IsDBNull(reader.GetOrdinal("deletedflag")))
                    resultRow.deletedflag = (bool)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("deletedflag")), typeof(bool));

                  if (!reader.IsDBNull(reader.GetOrdinal("shapename")))
                    resultRow.shapename = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("shapename")), typeof(string));
                  else
                    resultRow.shapename = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("copytoname")))
                    resultRow.copytoname = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("copytoname")), typeof(string));
                  else
                    resultRow.copytoname = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("typename")))
                    resultRow.typename = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("typename")), typeof(string));
                  else
                    resultRow.typename = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("filedata")))
                    resultRow.filedata = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("filedata")), typeof(string));
                  else
                    resultRow.filedata = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("createdate")))
                    resultRow.createdate = (global::System.DateTime)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("createdate")), typeof(global::System.DateTime));

                  if (!reader.IsDBNull(reader.GetOrdinal("createdby")))
                    resultRow.createdby = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("createdby")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("lastupdated")))
                    resultRow.lastupdated = (global::System.DateTime)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("lastupdated")), typeof(global::System.DateTime));

                  if (!reader.IsDBNull(reader.GetOrdinal("lastupdatedby")))
                    resultRow.lastupdatedby = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("lastupdatedby")), typeof(long));

                  ObjectStateEntry entry;
                  resultRow.EntityKey = 
                  new EntityKey("OMEGAEntities.patientshapefiles", new KeyValuePair<string, object>[] { new KeyValuePair<string, object>("id", resultRow.id) }); 
          
                  if (this.ObjectStateManager.TryGetObjectStateEntry(resultRow.EntityKey, out entry))
                    resultRow = (patientshapefile)entry.Entity;
                  else
                    this.Attach(resultRow);

                  result.patientshapefiles.Add(resultRow);
                }

                reader.NextResult();

                while (reader.Read()) {

                  patientshapemodification resultRow = new patientshapemodification();
                  if (!reader.IsDBNull(reader.GetOrdinal("id")))
                    resultRow.id = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("id")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("patientshapeid")))
                    resultRow.patientshapeid = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("patientshapeid")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("uniqueid")))
                    resultRow.uniqueid = (global::System.Guid)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("uniqueid")), typeof(global::System.Guid));

                  if (!reader.IsDBNull(reader.GetOrdinal("deletedflag")))
                    resultRow.deletedflag = (bool)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("deletedflag")), typeof(bool));

                  if (!reader.IsDBNull(reader.GetOrdinal("modnumber")))
                    resultRow.modnumber = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("modnumber")), typeof(long));
                  else
                    resultRow.modnumber = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("groupid")))
                    resultRow.groupid = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("groupid")), typeof(string));
                  else
                    resultRow.groupid = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("stepname")))
                    resultRow.stepname = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("stepname")), typeof(string));
                  else
                    resultRow.stepname = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("option")))
                    resultRow.option = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("option")), typeof(string));
                  else
                    resultRow.option = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("adjustparam")))
                    resultRow.adjustparam = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("adjustparam")), typeof(string));
                  else
                    resultRow.adjustparam = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("selectedflag")))
                    resultRow.selectedflag = (bool)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("selectedflag")), typeof(bool));
                  else
                    resultRow.selectedflag = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("modificationid")))
                    resultRow.modificationid = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("modificationid")), typeof(long));
                  else
                    resultRow.modificationid = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("controlstate")))
                    resultRow.controlstate = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("controlstate")), typeof(string));
                  else
                    resultRow.controlstate = null;

                  if (!reader.IsDBNull(reader.GetOrdinal("sequence")))
                    resultRow.sequence = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("sequence")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("preferredview")))
                    resultRow.preferredview = (string)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("preferredview")), typeof(string));

                  if (!reader.IsDBNull(reader.GetOrdinal("createdate")))
                    resultRow.createdate = (global::System.DateTime)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("createdate")), typeof(global::System.DateTime));

                  if (!reader.IsDBNull(reader.GetOrdinal("createdby")))
                    resultRow.createdby = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("createdby")), typeof(long));

                  if (!reader.IsDBNull(reader.GetOrdinal("lastupdated")))
                    resultRow.lastupdated = (global::System.DateTime)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("lastupdated")), typeof(global::System.DateTime));

                  if (!reader.IsDBNull(reader.GetOrdinal("lastupdatedby")))
                    resultRow.lastupdatedby = (long)Convert.ChangeType(reader.GetValue(reader.GetOrdinal("lastupdatedby")), typeof(long));

                  ObjectStateEntry entry;
                  resultRow.EntityKey = 
                  new EntityKey("OMEGAEntities.patientshapemodifications", new KeyValuePair<string, object>[] { new KeyValuePair<string, object>("id", resultRow.id) }); 
          
                  if (this.ObjectStateManager.TryGetObjectStateEntry(resultRow.EntityKey, out entry))
                    resultRow = (patientshapemodification)entry.Entity;
                  else
                    this.Attach(resultRow);

                  result.patientshapemodifications.Add(resultRow);
                }

                reader.NextResult();

              }

            }
            finally {
              if (needClose)
                connection.Close();
            }
            return result;
        }
Here are the errors I'm seeing.

Code: Select all

Error	60	'Omega.Data.patientshape' does not contain a definition for 'EntityKey' and no extension method 'EntityKey' accepting a first argument of type 'Omega.Data.patientshape' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	717	29	Omega
Error	61	'Omega.Data.OMEGAEntities' does not contain a definition for 'ObjectStateManager' and no extension method 'ObjectStateManager' accepting a first argument of type 'Omega.Data.OMEGAEntities' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	720	28	Omega
Error	62	'Omega.Data.patientshape' does not contain a definition for 'EntityKey' and no extension method 'EntityKey' accepting a first argument of type 'Omega.Data.patientshape' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	720	80	Omega
Error	63	'Omega.Data.OMEGAEntities' does not contain a definition for 'Attach' and no extension method 'Attach' accepting a first argument of type 'Omega.Data.OMEGAEntities' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	723	26	Omega
Error	64	'Omega.Data.patientshapefile' does not contain a definition for 'EntityKey' and no extension method 'EntityKey' accepting a first argument of type 'Omega.Data.patientshapefile' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	778	29	Omega
Error	65	'Omega.Data.OMEGAEntities' does not contain a definition for 'ObjectStateManager' and no extension method 'ObjectStateManager' accepting a first argument of type 'Omega.Data.OMEGAEntities' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	781	28	Omega
Error	66	'Omega.Data.patientshapefile' does not contain a definition for 'EntityKey' and no extension method 'EntityKey' accepting a first argument of type 'Omega.Data.patientshapefile' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	781	80	Omega
Error	67	'Omega.Data.OMEGAEntities' does not contain a definition for 'Attach' and no extension method 'Attach' accepting a first argument of type 'Omega.Data.OMEGAEntities' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	784	26	Omega
Error	69	'Omega.Data.patientshapemodification' does not contain a definition for 'EntityKey' and no extension method 'EntityKey' accepting a first argument of type 'Omega.Data.patientshapemodification' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	865	29	Omega
Error	70	'Omega.Data.OMEGAEntities' does not contain a definition for 'ObjectStateManager' and no extension method 'ObjectStateManager' accepting a first argument of type 'Omega.Data.OMEGAEntities' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	868	28	Omega
Error	71	'Omega.Data.patientshapemodification' does not contain a definition for 'EntityKey' and no extension method 'EntityKey' accepting a first argument of type 'Omega.Data.patientshapemodification' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	868	80	Omega
Error	72	'Omega.Data.OMEGAEntities' does not contain a definition for 'Attach' and no extension method 'Attach' accepting a first argument of type 'Omega.Data.OMEGAEntities' could be found (are you missing a using directive or an assembly reference?)	C:\Users\jkratz\Projects\omega\Omega\Data\OmegaEFModel.OMEGAEntities.cs	871	26	Omega

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Stored Procedure Returns Multiple Reference Cursors

Post by Shalex » Tue 26 Apr 2016 12:36

1. Please recreate your stored procedure without input refcursor parameters like described in our sample.

2. You are using EntityObject template in your model, aren't you?
We have just sent an updated EntityObject template (ObjectContext.tmpl) which includes a fix for the "does not contain a definition for 'EntityKey'" issue (missing System.Data.Entity.Core namespace in the generated file). Open your model, navigate to Tools > Entity Developer > Model Explorer > Templates, disable a predefined EntityObject, then enable the one we have sent to you. Does this help?

JIC: custom template is not updated when reinstalling Entity Developer. We will update a predefined template in the next public build.

Post Reply