locked
Passing null in UriOperationParameter gives Bad Request - Error in query syntax exception RRS feed

  • Question

  • ..as in the title, if OperationParameter plastName = new UriOperationParameter("lastName", lastName);

    and lastname is null, the exception is thrown. Is this normal behaviour?

    Regards,

    cp

    Sunday, December 2, 2012 4:26 AM

Answers

  • Never mind, found the solution. The parameters need to be checked for null value, and if true, they need to be simply omitted from the call to the service operation.
    • Marked as answer by Alexander Sun Monday, December 3, 2012 8:43 AM
    Sunday, December 2, 2012 6:47 AM

All replies

  • Never mind, found the solution. The parameters need to be checked for null value, and if true, they need to be simply omitted from the call to the service operation.
    • Marked as answer by Alexander Sun Monday, December 3, 2012 8:43 AM
    Sunday, December 2, 2012 6:47 AM
  • Hi cp.net,

    Welcome to the MSDN forum.

    Glad to know you solved this problem by yourself. Thank you for sharing.

    Have a nice day.


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, December 3, 2012 8:43 AM