phillips1021 (66) [Avatar] Offline
#1
I'm very much enjoying working my way through this book. I'm using Visual Studio for Mac Community Version 7.3.2 to work with the source code and examples.

In Chapter 12 you designed the database connection to use MS SQL Local database:

"...SQL Server Express’ Local DB feature. This is installed as part of Visual Studio 2017 (when you choose the .NET Desktop Development workload) and provides a lightweight SQL Server engine."

How can I use a local database on my Mac for working with Entity Framework?

Since one of the primary purposes of .net core is to be enable cross platform development and running of .net applications it would be great to know how to build and run applications that use .net core EF on my Mac.

Thank You,

Bruce
272349 (2) [Avatar] Offline
#2
Hi,

SQL Server 2017 is available for Linux, and you can use it on OSX with Docker. The downside is that it require something like 4Go of RAM to start.. (it's SQL Server fault, not Docker).

More informations : https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker

I hope this will help you.
Andrew Lock (48) [Avatar] Offline
#3
Alternatively, I recommend taking a look at PostgreSQL. I wrote a post a while back on getting started with PostgreSQL on OS X - it's a little out of date, but hopefully you're able to get the gist of it smilie
272349 (2) [Avatar] Offline
#4
+1 for PostgreSQL (for many reasons)

It's easy to start with https://postgresapp.com/ on OSX.
Andrew Lock (48) [Avatar] Offline
#5
And this is the link to my blog post: https://andrewlock.net/adding-ef-core-to-a-project-on-os-x/
259675 (2) [Avatar] Offline
#6
Microsoft's tutorials on ASP.NET Core explain how to use SQLLite in an MVC project on macOS.
https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app-mac/working-with-sql

SQLLite is a lightweight, cross-platform database that you can use with Entity Framework Core.
https://www.sqlite.org/index.html
welkie (21) [Avatar] Offline
#7
Another +1 for PostgreSQL. It's got a solid provider available for EF Core. With Docker, you can spin up a PostgreSQL container even if you have limited memory. I have 6 containers running on a 2 GB VPS right now, one of which is PostgreSQL.