This is a migrated thread and some comments may be shown as answers.

GetObjectId - find newly inserted id

2 Answers 54 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Robert
Top achievements
Rank 2
Robert asked on 10 Aug 2010, 04:21 PM
Hi,

when I have persisten object instance, how can I find it's primary key id? With object scope it was possible with GetObjectId, how can I accomplish this in domain model approach?

thanks,
Robert

2 Answers, 1 is accepted

Sort by
0
Accepted
Petko_I
Telerik team
answered on 11 Aug 2010, 05:02 PM
Hello Robert,

This functionality together with executing SQL queries directly and subscribing to CUD Tracking events can be accomplished with exposing the protected method GetScope of the generated Entity Diagrams context. To do this, you can inherit from the context class and define a public method whose only purpose is to invoke the protected GetScope. Here is an example.

If you have any further questions, feel free to ask and we will respond in a timely manner.

All the best,
Petko_I
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Robert
Top achievements
Rank 2
answered on 17 Aug 2010, 01:46 PM
Thanks, this is exactly what I need!

Robert
Tags
Getting Started
Asked by
Robert
Top achievements
Rank 2
Answers by
Petko_I
Telerik team
Robert
Top achievements
Rank 2
Share this question
or