locked
Populate edm before service is called RRS feed

  • Question

  • Hello again,

    In the edm I map my tables to  query stored procedures.

    Im guessing that when the serivce is referenced, the tables in the edm get filled in the background.

    Since my tables are very big, I don't want to fill them with all the data but a filltered one (i.e poulating the tables according to range of dates).

    Is It possible to populate the edm tables before the serivce is being call ? how can I do that ? (an example will Be great)

    Thanks,

    Ronchuk 

    • Edited by ronchuk Thursday, August 13, 2009 7:20 AM
    Thursday, August 13, 2009 7:19 AM

Answers

  • Ok , from what I understand ,if you look at the CurrentDataSource , then all the tables are filled with data or the ObjectQueries have data filled in them.

    How are you evaluating if the data from the table is filled ?
    Since this is EF, if you try to look at the collection and expand the GetResults() node in the Quick-Watch/Watch window , then the EF will make a call to the database for the results .  So , by virtue of observing the results of the tables , you are causing the tables to be filled.
     By default , we do not bring all the data in the tables during query processing , we only ask for those entities which will be required to complete the request.
    Hope this helps.


    Phani Raj Astoria http://blogs.msdn.com/PhaniRaj
    Thursday, August 13, 2009 5:23 PM
    Moderator

All replies

  • Hi ,
     "when the serivce is referenced" do you mean when you use "Add Service Reference" ?
      In the Astoria runtime , on the server , we do not load the data inside the tables when generating the metadata.
      In EF , We only read the model artifacts such as the Model.edmx file to populate the metadata of the service.
      Hope this helps.
    Phani Raj Astoria http://blogs.msdn.com/PhaniRaj
    Thursday, August 13, 2009 4:55 PM
    Moderator
  • Hi

    I maped two conceptual entities to two tables in the database (very simple one) Author and Article.

    When my service operation GetArticles() get executed, I've noticed that currentDataSource' tables are filled with all the data.

    How can i avoid this ? I want to fill the tables according to specific dates ? should I implement the CreateDataSource method of the IRequestHandler ?

    How can I do that ? I don't want that my currentDataSource will be filled up with all the data in the DB.
     
    I hope that my questions are clearer now

    thanks again,

    Ronchuk
    Thursday, August 13, 2009 5:14 PM
  • Ok , from what I understand ,if you look at the CurrentDataSource , then all the tables are filled with data or the ObjectQueries have data filled in them.

    How are you evaluating if the data from the table is filled ?
    Since this is EF, if you try to look at the collection and expand the GetResults() node in the Quick-Watch/Watch window , then the EF will make a call to the database for the results .  So , by virtue of observing the results of the tables , you are causing the tables to be filled.
     By default , we do not bring all the data in the tables during query processing , we only ask for those entities which will be required to complete the request.
    Hope this helps.


    Phani Raj Astoria http://blogs.msdn.com/PhaniRaj
    Thursday, August 13, 2009 5:23 PM
    Moderator