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.

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
  • 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? – markokstate Jan 25 '17 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.

  • 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. – markokstate Jan 25 '17 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". – Wyatt Barnett Jan 25 '17 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.