Reputation: 63
I am currently writing a web application in ASP.NET MVC, so far it is mostly a simple CRUD web app. The database is hosted on the cloud and I am using Entity Framework to interact with it.
I know that further in the development cycle we will have to make a mobile application (iOS with swift) which will interact with the same database, so I want to have a good framework that will be able to handle both without too much duplication of code or DAL, while still being secure.
Those are the options I have so far:
Upvotes: 3
Views: 3673
Reputation: 34846
I highly recommend that you go the option of an API that both your ASP.NET MVC
web application and the mobile application both talk to. Using ASP.NET Web API
for this is a good choice, as it works well with both, current, consumers (MVC
and iOS
) that you have. REST
is a very open standard and, as such, allows for a wide breadth of devices to connect to it; ASP.NET Web API
was built with REST
in mind.
A JSON web token
(JWT) approach to security would also be wise, as that will allow you to support a wide array of devices (cookies are limited in that respect). You might want to consider using OAuth
on your ASP.NET Web API
in order to leverage open standards security and leverage authentication via third party (Google, Microsoft, etc.) if that is desired or feasible for your project.
Upvotes: 3