locked
How can I run a WCF RIA query returning a single entity not having a load method? RRS feed

  • Question

  • I have a WCF RIA query that takes a few arguments and returns a single entity object. When I use in a Lightswitch screen, I can unset "Auto Execute Query", but there is no load() method to execute the query in code. I'm guessing this is because it returns a single entity instead of a collection.

    How do I run this in code?



    Bruce

    Thursday, August 15, 2013 7:49 PM

Answers

  • Question.

    Why do you use WCF RIA to return a single entity instead of using preprocess query and filter the collection acording to parameteres?

    Can you post the WCF RIA code of that particular entity?

    Also the Load() method is usually found in the main query of the screen, no in the entity. For example if you created the screen with the query "Backuprecord" you can put in the created() method of that screen:

    Bacuprecord.load();

    But I strongly recommend that you use a preprocess query.

    Regards,




    The things that would normally cause you to use a WCF RIA Service:

    1) The result is comprised of more than 1 data source (please don't ever try that in a Preprocess query :)) even if that other data source is an internal table.

    2) You are performing calculations (the performance of a WCF RIA Service can be massively better and it's results are searchable, sortable, and updateable).

    3) You are accessing a resource outside of the LightSwitch database (another database, the file system, a web service, a COM object, ect.)


    Unleash the Power - Get the LightSwitch HTML Client book

    http://LightSwitchHelpWebsite.com

    • Marked as answer by Angie Xu Monday, August 26, 2013 2:17 AM
    Friday, August 23, 2013 6:00 PM

All replies

  • Question.

    Why do you use WCF RIA to return a single entity instead of using preprocess query and filter the collection acording to parameteres?

    Can you post the WCF RIA code of that particular entity?

    Also the Load() method is usually found in the main query of the screen, no in the entity. For example if you created the screen with the query "Backuprecord" you can put in the created() method of that screen:

    Bacuprecord.load();

    But I strongly recommend that you use a preprocess query.

    Regards,




    Friday, August 23, 2013 2:00 PM
  • Question.

    Why do you use WCF RIA to return a single entity instead of using preprocess query and filter the collection acording to parameteres?

    Can you post the WCF RIA code of that particular entity?

    Also the Load() method is usually found in the main query of the screen, no in the entity. For example if you created the screen with the query "Backuprecord" you can put in the created() method of that screen:

    Bacuprecord.load();

    But I strongly recommend that you use a preprocess query.

    Regards,




    The things that would normally cause you to use a WCF RIA Service:

    1) The result is comprised of more than 1 data source (please don't ever try that in a Preprocess query :)) even if that other data source is an internal table.

    2) You are performing calculations (the performance of a WCF RIA Service can be massively better and it's results are searchable, sortable, and updateable).

    3) You are accessing a resource outside of the LightSwitch database (another database, the file system, a web service, a COM object, ect.)


    Unleash the Power - Get the LightSwitch HTML Client book

    http://LightSwitchHelpWebsite.com

    • Marked as answer by Angie Xu Monday, August 26, 2013 2:17 AM
    Friday, August 23, 2013 6:00 PM