locked
Why is the DataServiceConfiguration.AnnotationsBuilder delegate called on all requests? RRS feed

  • Question

  • I would expect that the DataServiceConfiguration.AnnotationsBuilder eventhandler only got called on $metadata requests.

    Any reason for this?

    (I have a custom DS provider implementation)

    Regards

    Uffe

    Wednesday, May 9, 2012 6:20 AM

Answers

  • Hi Uffe,

    Thanks for the question. This is actually the intention. The delegate is supposed to be called only when there is a metadata request. We may have a bug about requests where metadata is actually created; we will have a deeper look and see if we can fix in upcoming iterations.

    The actualy merging of annotations with the underlying model should not be a big performance hit but however, in the meantime to work this around you can check in the annotations delegate whether the request is for $metadata and only execute the annotations code if this is the case.

    Thanks,

    Turker

    • Marked as answer by Uffe Lauesen Tuesday, May 29, 2012 1:59 PM
    Friday, May 25, 2012 11:56 PM

All replies

  • Hi Uffe Lauesen,

    Welcome to MSDN Forum.

    We will do some more pending research about your problem and come back as soon as possible, thanks for understanding!

    Have a nice day!


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 10, 2012 7:29 AM
    Moderator
  • Hi Uffe,

    Thanks for the question. This is actually the intention. The delegate is supposed to be called only when there is a metadata request. We may have a bug about requests where metadata is actually created; we will have a deeper look and see if we can fix in upcoming iterations.

    The actualy merging of annotations with the underlying model should not be a big performance hit but however, in the meantime to work this around you can check in the annotations delegate whether the request is for $metadata and only execute the annotations code if this is the case.

    Thanks,

    Turker

    • Marked as answer by Uffe Lauesen Tuesday, May 29, 2012 1:59 PM
    Friday, May 25, 2012 11:56 PM
  • Thanks Turker,

    Yes in my delegate I am checking the request to se if it is a $metadata request before i do my processing. I just wanted to notify you of the issue and see if there were something that I had missed.

    Thanks for confirming and looking into the issue.

    Regards

    Uffe

    Tuesday, May 29, 2012 1:59 PM