locked
serverapplicationcontext skip filter RRS feed

  • Question

  • Hi, I've a WebAPI controller with ServerApplicationContext, but when I set a filter return HTTP Error 500 because query throw nullreferenceexception.

    How can I bypass filter when query came from WebAPI?

    Wednesday, October 22, 2014 8:37 PM

Answers

  • 1) You can call the LightSwitch database directly in your WebAPI method using ADO.NET

    2) You can create a WCF RIA Service (it will bypass any filters) and then that can be called by ServerApplicationContext and consumed by WebAPI  


    Unleash the Power - Get the LightSwitch 2013 HTML Client / SharePoint 2013 book

    http://LightSwitchHelpWebsite.com

    • Marked as answer by fileman Thursday, October 23, 2014 2:24 PM
    Thursday, October 23, 2014 11:56 AM
  • Hi, I've a WebAPI controller with ServerApplicationContext, but when I set a filter return HTTP Error 500 because query throw nullreferenceexception.

    NullReferenceException was query and not filter issue.

    Solution was to change query syntax, instead of apply where clause in the "details" table with the foreign key, I need to get "master" entity and then filter her details.

    • Marked as answer by fileman Sunday, November 2, 2014 5:55 PM
    Sunday, November 2, 2014 5:55 PM

All replies