GetObjectId - find newly inserted id

3 posts, 1 answers
  1. Robert
    Robert avatar
    21 posts
    Member since:
    Feb 2009

    Posted 10 Aug 2010 Link to this post

    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. Answer
    Petko_I
    Admin
    Petko_I avatar
    184 posts

    Posted 11 Aug 2010 Link to this post

    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
  3. DevCraft banner
  4. Robert
    Robert avatar
    21 posts
    Member since:
    Feb 2009

    Posted 17 Aug 2010 Link to this post

    Thanks, this is exactly what I need!

    Robert
Back to Top