Posts

Showing posts from March, 2018

Using Entity Framework Core with MySQL for .Net Core 2 Web API

Image
.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

Host an ASP.Net Core project in Bitbucket (Using Visual Studio for Mac)

Image
When you are stared to do your own project the main concern and the importance will be the security of your source code. How do you make sure it is safe? What happen if you lose your hard drive or your laptop which have all your project source code? All of your effort will lose, isn't it? But nowadays you can safeguard your code using a source control service. Bitbucket is a great place to start. It has a free plan for small teams, so you can use this. In this post I'll explain how to host your .Net Core project using Bitbucket from mac. Let's get started. Prerequisites Before we get stared you have to install following in your mac. 1. Git - Download it from  https://git-scm.com/downloads  and install it. 2. Visual Studio for Mac - Download it from  https://www.visualstudio.com/vs/mac/  and install it. Ok. I assume that you have all the prerequisite software installed in your mac. Now follow the bellow steps. 1. Create an account in Bitbucket ( https://bitb