locked
Data Services and Business Logic RRS feed

  • Question

  • I have got as far as using using partial classes generated by my EDM to put business logic - if I was serving up data via ADO.net data services how do I communicate business logic errors? Regards, Chris.

    Thursday, September 25, 2008 9:13 PM

Answers

All replies

  • AFAICT, they recommend using DataServiceException.

    If you let other exceptions pop out of the DS, the DS converts it to a generic DataServiceException with "An error occured processing request." message.  This, I guess, is for security reasons.  If you throw (or rethrow) a DataServiceException, you can set the error code and message to something useful for the client side without exposing internals.  Does that answer your question?

    Friday, September 26, 2008 12:33 AM
  • It answers part of the question. Where does the logic go - is it in the query interceptor that I have read about. Regards, Chris.

    Friday, September 26, 2008 7:46 AM
  • Right.  It is in the query interceptors, it is in any change interceptors, it is in your WebGet methods.

    Friday, September 26, 2008 2:05 PM
  • I just replied to your other mail thread - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3934627&SiteID=1

    . Hope this helps.

     

    Thanks

    Pratik

    Monday, September 29, 2008 4:55 PM
    Moderator