CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • CSLA .NET Data Helpers for Windows Phone

    rated by 0 users
    Answered (Verified) This post has 1 verified answer | 6 Replies | 2 Followers

    Top 500 Contributor
    34 Posts
    mesh posted on Mon, Feb 6 2012 2:36 AM

    Hi,

    there is no CSLA .NET Data Helpers for Windows Phone? Windows Phone supports Linq To SQL CE. I think that ContextManager, DataMap, DataMapper and maybe TransactionManager should be included in Csla.Data for Windows Phone.

     

    Thanks,

     

    mesh

    Answered (Verified) Verified Answer

    Top 10 Contributor
    9,475 Posts
    Verified by mesh

    That is a good observation, and we should add appropriate support for SQL CE - I'll add this to the wish list.

    Rocky

    All Replies

    Top 10 Contributor
    9,475 Posts
    Verified by mesh

    That is a good observation, and we should add appropriate support for SQL CE - I'll add this to the wish list.

    Rocky

    Top 500 Contributor
    34 Posts
    mesh replied on Thu, Feb 9 2012 7:01 AM

    Thanks.

    I hope it will include support  for synchronous data portal methods.

    mesh

    Top 10 Contributor
    9,475 Posts

    It will not include support for synchronous data portal concepts, no. The idea of synchronous file or database IO is on its way out.

    The new Windows Runtime (WinRT) in Windows 8 (and then Windows Phone 8 if rumor is correct) doesn't allow synchronous file or database IO.

    No sense supporting a concept that is soon to be entirely gone.

    In fact, what is more likely is that the .NET data portal will be changed to support async - though that'll almost certainly be done in a way that relies on the async/await keywords in .NET 4.5.

    Rocky

    Top 500 Contributor
    34 Posts
    mesh replied on Thu, Feb 23 2012 1:54 PM

    Hi Rocky,

    I'm reading Using CSLA 4.0: Windows Phone and can not understand how should I implement ProjectGetter's GetExistingProject method when using local database? There is no synchronous DataPortal_Fetch available.

    So, how can I implement async DataPortal_Fetch(Criteria criteria, Csla.DataPortalClient.LocalProxy<ProjectGetter>.CompletedHandler handler) method and load Project and RoleList in it?

    Thanks

    mesh

    Top 10 Contributor
    9,475 Posts

    There is no synchronous data portal in Silverlight, or the phone.

    However, the client-side DataPortal_Fetch is not inherently asynchronous. It is invoked synchronously by the data portal. The requirement is that your code must invoke the callback handler when the method is complete.

    The primary idea here is that you'd make an async call to a service, and when that call completes you'd invoke the handler.

    But there is absolutely nothing stopping you from making a synchronous data access call and then calling the handler. Other than when your users get upset with your app anyway... Because if you do this, you'll block the user. I actually don't know exactly how badly, but probably badly.

    What you should do is use a BackgroundWorker from the Csla.Threading namespace to do the data access on a background thread, and to invoke the callback handler when the background task completes. That way you won't block the user because your synchronous data access will run on that background thread.

    Rocky

    Top 500 Contributor
    34 Posts
    mesh replied on Fri, Feb 24 2012 2:41 AM

    Thanks.

    mesh

    Page 1 of 1 (7 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems