locked
Migrating WCFRIA/ENTITY Framework features to new sync service product? RRS feed

  • Question

  • I, have been wanting to take ourapplication to an Occasionally Connected Application (OCA) for some time now, but have not found all the necessary pieces coming together for us to justify, what in effect meant writing huge amounts of boiler plate code(having to use antiquated COM or third party db tool/ integration with sync etc)

     

    This is all until I saw the presentation at PDC, and must say was very well explained how the new synch service helps us share data model on server and client, synch data sources etc. This has convinced me that we can now offer this product to clients as a workable solution. I do however have a central question 

    I use Silverlight client connecting via WCFRIA to an ORM, in the form of entity framework. All of my business logic is located within the factory layer in the form of LINQ queries and meta data declarations using partial classes (as indicated by best practices). Thus as an example we use the [Include] attribute within partial class declarations and then within the corresponding query use the linq extension .Include, to thus bring back a nested entity (i.e. order details within an order entity). This is one example and we indeed make use of other attributes such as [Composition], and [Association].

     

    My question is this:

    Is it possible to extend the current capabilities of the DefualtscopeOfflineContext file so that we can in effect extend to also use attributes such as the aforementioned [Include]. The reason I ask is that I have over 200 LINQ queries in my application and would like to simply reuse the same code for a service data source, as well as an offline data source. For simple queries this is fine and I can see working, it is just the use of the more advanced attribute decorations that causes issues.

     

    Thank you in advance for your help

    Monday, January 10, 2011 6:00 PM

Answers

  • Unfortunately the answer is yes for the timebeing. Sorry.
    Maheshwar Jayaraman - http://blogs.msdn.com/mahjayar
    Tuesday, February 1, 2011 9:39 PM

All replies

  • hi,

    What you mention is currently not possible as the sync service uses providers which are based on raw ADO.NET queries and data access model and does not use Linq. The two server runtimes from RIA and our sync service is completely different and the attributes from RIA doesnt quite work with our service.


    Maheshwar Jayaraman - http://blogs.msdn.com/mahjayar
    • Proposed as answer by Sameer[MSFT] Monday, January 17, 2011 8:55 PM
    Friday, January 14, 2011 6:36 PM
  • Hi,

    Is there any way to get round this, or do I effect need two 'data models', and two factory versions?

    Also is there any plans to do such things, as this is frustrating, building an SL using the recommended WCFRIA and entity framework, only to find we cannot build a version in offline mode, without rewriting significant amounts of cnversions code?

    Thanks in advance

    Friday, January 21, 2011 2:48 PM
  • Unfortunately the answer is yes for the timebeing. Sorry.
    Maheshwar Jayaraman - http://blogs.msdn.com/mahjayar
    Tuesday, February 1, 2011 9:39 PM
  • Hi, Thanks for the reply, do you know if such developments are on the horizon, so at least I know in the futire this integration will be more streamlined, i..e is there any idea of timeframes? Thanks
    Wednesday, February 2, 2011 9:46 AM