This is a migrated thread and some comments may be shown as answers.
Turn Off Change Tracking in New API
1 Answer 40 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 27 Apr 2012, 04:08 PM
Hello,

How can I disable change tracking on objects returned from a query?  I'm using the new API; most of the google results returned using the Object Scope from the old API, so I couldn't find any documentation...

Thanks.

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 02 May 2012, 09:42 AM
Hi Brian,

Currently we are working on providing functionality for attaching and detaching persistent capable objects to an OpenAccessContext instance. We will do our best to finish the implementation for the upcoming release.

What you could do to detach persistent object from the context is to deserialize it. This help article shows how to achieve that goal. You need to expose the underlying IObjectScope object. The OpenAccessContextBase class has a method named GetScope, which could be used. You could also extend your domain context with another partial class and add the following property, if it makes it easier to access:

public partial class EntitiesModel
{
    public IObjectScope Scope
    {
        get
        {
            return this.GetScope();
        }
    }
}

Hope that helps.

Regards,
Damyan Bogoev
the Telerik team
Follow @OpenAccessORM Twitter channel to get first the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Tags
General Discussions
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or