Build a Basic FullStack app using C#(.NET Core), MySQL and Webpack/React. (1/3)

“black and gray laptop computer turned on” by Markus Spiske on Unsplash

Step One: The setup.

We will first install mysql workbench which will hold our database.

Create a database server if needed.
Create User.
Have your solution names Games, and your web project be named Games.Web
Create a web api project.
Add a project to your solution which would be a class library. For the Domain, Data, and Services.
How your solution are setup

Configuring your Database.

We will now setup our database using entity framework core and create our database using the code-first way. So we will first define our entity models in our .Domain class library project.

public abstract IEnumerable<GameViewModel> GetGames();
Define your abstract entity class.
Define your Game class.
Define the context class that will be used to bridge our Project and our database.
Define your connection string.
Dependencies needed for Web Project.
Configure your Database context.
Update Database result in mysql server.
Your repositories structure.
Define your GamesRepository signature which would be IGamesRepository file.
Define your GamesRepository class.
Dependency inject your Repositories with a scoped context.
Services Project folder structure.
Define the view model class which would be displayed to the user.
Define a static class (ModelFactory) that is responsible for making data suitable for the repository or the user.
Services folder structure.
Define a interface/signature for your GamesService class.
Create your GameServices class.
Configure your services using dependency injection.
Define the games controller method.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store