Search found 3 matches

by jdaly
Tue 24 Jun 2008 03:43
Forum: dotConnect for Oracle
Topic: Function Import missing from ObjectContext
Replies: 9
Views: 7371

Thanks Alexey, very helpful.

I also am trying to work out how to invoke a sproc via the ObjectContext which just does a SELECT, and can't figure that out. Is there a way?

The reason I want to do this is to invoke a sproc which returns the result from a call to GetNextID on an oracle sequence, to use to populate a primary key property on a new object prior to calling save on the context.

And the reason I want to do that is because our DBA is nervous about us using triggers on inserts to populate primary keys on the table.

I was expecting to be able to write code like this:

Code: Select all

using(MyObjectContext ctx = new MyObjectContext())
  long ID = ctx.GetNextID();
where "GetNextID" is mapped to a sproc.
by jdaly
Fri 20 Jun 2008 03:00
Forum: dotConnect for Oracle
Topic: Function Import missing from ObjectContext
Replies: 9
Views: 7371

Function Import missing from ObjectContext

According to the ADO.NET Entity Framework I should be able to invoke a stored proc via the ObjectContext. I have followed the steps of including a sproc in my entity model and creating a function import for it, but I cannot see a method on my ObjectContext class to enable me to invoke the sproc in code. Am I missing something? How am I supposed to call the sproc once I have included it in the entity model?
by jdaly
Fri 20 Jun 2008 01:57
Forum: dotConnect for Oracle
Topic: Accessing primary key of new obj after a call to SaveChanges
Replies: 1
Views: 1939

Accessing primary key of new obj after a call to SaveChanges

I'm using OraDirect.NET in the context of the ADO.NET Entity Framework. Having created a new object, and called "SaveChanges" on the ObjectContext, I want to obtain that objects primary key value. On the database, this is generated using a sequence and trigger.

It would be nice if I could easily get access to the primary key, following an insert. Do you know of a way?