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

Equivalence of AsNoTracking()

3 Answers 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jhonattan
Top achievements
Rank 2
Jhonattan asked on 19 Mar 2014, 02:09 PM
In Telerik Data Access, What is the equivalence to the EntityFramework AsNoTracking method?

3 Answers, 1 is accepted

Sort by
0
Kristian Nikolov
Telerik team
answered on 21 Mar 2014, 03:46 PM
Hi Jhonattan,

Telerik Data Access offers the Detach/Attach API. The Detach method detaches an entity or enumeration of entities from the context. Just as with AsNoTracking, the resulting objects are not tracked for changes by the context.

The difference is that objects returned by the Detach method still have state. If they are later attached to the context, they will automatically introduce changes to it if they have been modified even while they have been detached.

Furthermore, the Detach method can be combined with Fetch Strategies in order to disconnect entire hierarchies of related objects from the context.

If you are interested in seeing an example of our Detach/Attach API in action, please check out the Using the Context API sample from our Samples Kit. In it, there are unit tests that demonstrate the behavior of Detach, Attach and how attached or detached objects impact the context. You will also be able to find tests demonstrating Fetch Strategies.

I hope this helps. If you have additional questions, feel free to post at our forums again.

Regards,
Kristian Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Jhonattan
Top achievements
Rank 2
answered on 27 Mar 2014, 07:26 PM
Hi,

This means that  there was a previous process to attach query result in context, this is a penalty for perfomance, why do not make a simple way to return query result without tracking? like a micro-orm.
0
Accepted
Kristian Nikolov
Telerik team
answered on 31 Mar 2014, 03:51 PM
Hello Jhonattan,

The detach operation is generally fast enough to avoid negative performance impact. That being said, it will not make your queries faster as AsNoTracking can do.

In order to simplify development and reduce the amount of code which developers need to write, change tracking is automatically injected directly in your persistent classes by the Enhancer tool. This is a core functionality around which Telerik Data Access is designed. Therefore introducing a feature similar to AsNoTracking may not be currently possible.

In case you have any more questions, feel free to use our forums again.

Regards,
Kristian Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
General Discussions
Asked by
Jhonattan
Top achievements
Rank 2
Answers by
Kristian Nikolov
Telerik team
Jhonattan
Top achievements
Rank 2
Share this question
or