0

My team currently has a WPF application that runs on PC just fine. It utilizes Entity Framework 6 with the Repository/Unit of Work pattern that talks to Azure for the database store.

We service a little over 300 clients currently. But, we're wanting to expand our footprint for the app and transition to mobile devices. Our goal is to leverage Xamarin to do all the cross platform work and still keep all of our C# logic. First Universal Windows Platform, then Apple or Android, but all 3 eventually.

My question is: Do we need to transition to a Web API based call to the database to support cross platform? Is there any reason we should get away from Entity Framework? Is it less secure/reliable for the activities we'll be doing? Can we at least keep Entity Framework for the Universal Windows Platform?

Most cross platform devs I meet are not C# devs, so they always say you gotta have the web API but I'm a bit stuck on the WHY.

0

    2 Answers 2

    1

    Do we need to transition to a Web API based call to the database to support cross platform?

    Yes.

    Here's why: you'll need a common, web-enabled API for your three front-ends to talk to. Entity Framework won't execute queries to your DB server over the Internet.

    Is there any reason we should get away from Entity Framework?

    No. You can use it to build the Web API. You can even retain your Repository/Unit of Work layers, if you want to. Here's what your architecture might conceptually look like:

    DB <--> Entity Framework <--> Repository/UOW <--> Web API Endpoint <==> Frontend ^ JSON over Internet 
    2
    • Right now all the Entity Framework and Unit of Work logic resides on the application itself and not nested in any server. Will all of that need to be pulled out and relocated more closely to the DB? Is my best bet searching for some tutorials to convert EF repo/UOW to Web API Endpoints?CommentedJan 25, 2017 at 15:56
    1

    You will also want to re-think your data access calls as you move from a local database via EF to a remote database via WebAPI. You will generally want to be less chatty while also being more succinct because mobile data is extremely unreliable and glacially slow compared to the 10gb connection to your database server.

    2
    • Nothing is stored locally, it is all setup in the app to make the call directly to the database. It is setup much like an enterprise system would be. I have a feeling there will be lots of growing pains for this transition.CommentedJan 25, 2017 at 15:57
    • @markokstate -- locally in the sense of "a database server sitting in the same datacenter" versus "a database located across an unreliable cell network and a semi-reliable wired internet that happens to be a few thousand miles away".CommentedJan 25, 2017 at 18:37

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.