The Doctor needs a webpage to manage all those crazy machines and those loopy engineers. This webpage uses MVC, EF Core Migrations, many-to-many relationships and one-to-many relationships and incorporates CRUD functionality to allow the user to manage the factory database.
- C#
- .NET
- ASP.NET Core
- MVC
- Entity Framework Core
- Pomelo Entity Framework Core
- EF Core Migrations
- Html Helpers
- MySQL
- Clone this repo.
- Open your terminal (e.g. Terminal or GitBash) and navigate to this project's directory called "Factory".
- Set up the project:
- Create a file called 'appsettings.json' in Factory.Solution/Factory directory
- Add the following code to the appsettings.json file:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Port=3306;database=factory;uid=[YOUR_SQL_USER_ID];pwd=[YOUR_SQL_PASSWORD];"
}
}
- Make sure to plug in your SQL user id and password at
[YOUR_SQL_USER_ID]
and[YOUR_SQL_PASSWORD]
- Set up the database:
- Make sure EF Core Migrations is installed on your computer by running
dotnet tool install --global dotnet-ef --version 6.0.0
- In the production folder of the project (Factory.Solution/Factory) run:
dotnet ef database update
- You should see the new schema in your Navigator > Schemas tab of your MySql Workbench on refresh called
factory
- Running the project in your browser:
- Navigate to the production directory "Factory" from your terminal.
- Run the command from Factory
dotnet watch run
- Your browser should automatically open
https://localhost:5001/
. You may need to enter your computers password when prompted to allow ASP.NET Core to run in your browser.
- Engineer and Machine do not need to be in same location
MIT
Copyright © 2023 Emma Gerigscott