How to use Entity Framework Core with SQL Server in Xamarin Forms?

c# entity-framework-core sql-server xamarin xamarin.forms

Question

I'm trying to use Entity Framework Core with SQL Server (not SQLite) in a Xamarin forms app but I just can't figure it out! All tutorials explain how to use EF Core with sqlite! Are there any clear documentation or tutorials?

1
0
6/21/2019 4:42:44 PM

Popular Answer

About connect to a Remote DataBase in Xamarin.Forms, I find one article that you can take a look:

https://xamarinhelp.com/connecting-remote-database-xamarin-forms/

You may be wondering why you couldn’t just connect directly to a database from your mobile app? The main reasons are:

Security

You don’t want your mobile client apps to have a database connection string with a username and password in it. It opens your database up to anyone. You can create a user with read only permissions and only allow access to certain tables, but they could still see all data in these tables. On an API, you can implement additional security checks and have authentication based on OAuth or an existing user management system.

Performance

Database connections weren’t designed to go over high latency connections. It is likely your database connection would keep dropping, forcing you to reconnect every time.

Control

With an API you can control the flow of data to and from your database. You can implement rate limiting, and monitoring of all of your requests. If you need to change business logic, or even what database or resources are used via each API request, you can do this on the server, without having to redeploy a mobile app.

Resources

With an API, you reduce the need for server resources. While you may have to setup another server to handle an API, the REST API is designed to be stateless and efficient. Scaling to many users in the future is easier with an API.

1
6/24/2019 3:00:07 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow