none
objectset append only, still queries db RRS feed

  • Question

  • I have an objectset with merge option Append Only.

    If I Excecute 2 times :

    MyObjectSet.SingleOrDefault(vt => vt.Id == 2);

    MyObjectSet.SingleOrDefault(vt => vt.Id == 2);

    I see 2 times a db query launched (in sql profiler).

    Why is this?

    Note : I use poco proxies.

    Wednesday, December 21, 2011 9:06 AM

Answers

  • Hi voilbak,

    Welcomet to MSDN Forum.

    Based on the issue, I researched from MSDN. I found if you set the MergeOption to AppendOnly, the object is already in the context will not be overwritten by the datasource values. I didn't find anything about if the object has already in the context, you query the same object again, it will not query the database. More information about it, please refer to the link below.

    Identity Resolution, State Management, and Change Tracking

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us
    Friday, December 23, 2011 2:52 AM
    Moderator