Equivalence of AsNoTracking()

4 posts, 1 answers
  1. Jhonattan
    Jhonattan avatar
    16 posts
    Member since:
    Sep 2009

    Posted 19 Mar 2014 Link to this post

    In Telerik Data Access, What is the equivalence to the EntityFramework AsNoTracking method?
  2. Kristian Nikolov
    Admin
    Kristian Nikolov avatar
    206 posts

    Posted 21 Mar 2014 Link to this post

    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.
     
  3. DevCraft banner
  4. Jhonattan
    Jhonattan avatar
    16 posts
    Member since:
    Sep 2009

    Posted 27 Mar 2014 in reply to Kristian Nikolov Link to this post

    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.
  5. Answer
    Kristian Nikolov
    Admin
    Kristian Nikolov avatar
    206 posts

    Posted 31 Mar 2014 Link to this post

    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.
     
Back to Top