Using Entity Framework Core with MySQL for .Net Core 2 Web API
.Net Core 2.0 released and you might using it for learning or actual production purposes. With .Net Core you usually use Entity Framework Core to communicate with your database, and usually you might use MS SQL Server with this environment. But have you thought about MySql Database? Couldn't find any good resource to how to do this? Then you are in the correct place. In this post I'll explain you how to use MySql as you Database while using .Net Core backend. Let's get started. I'm developing this in a Mac and I'm using Visual Studio Community for Mac. For this example I'll create a Web API project and get pre entered data from MySql database. 1. Open MySql management tool and do following. 1.1. Create a database (UserDB) 1.2. Create a table (Users) 1.3. Add fields to Users table (Username, Password, etc.) 1.4. Add some sample data to the table. 2. Create a .Net Core Web API project using Visual Studio. I have created as UserLog...