Authored by Brian Sturgis
Updated on March 26th, 2021
This is an MVC web application with user authentication and a many-to-many relationship.
- The application should have user authentication. A user should be able to log in and log out. Only logged in users should have create, update and delete functionality. All users should be able to have read functionality.
- There should be a many-to-many relationship between Treats and Flavors. A treat can have many flavors (such as sweet, savory, spicy, or creamy) and a flavor can have many treats. For instance, the "sweet" flavor could include chocolate croissants, cheesecake, and so on.
- A user should be able to navigate to a splash page that lists all treats and flavors. Users should be able to click on an individual treat or flavor to see all the treats/flavors that belong to it.
- repository location (https://github.com/BrianSturgis/JanWeek12Project.solution
- open through a git terminal or clone editor.
- got to repo location.
- using git commands clone to local repo or click "download" and unpack on machine
- Confirm you have installed .NET installed - this will provide access to the C# language
- Below are instructions for the
dotnet script
REPL:- Install
dotnet script
by running the following terminal command:$ dotnet tool install -g dotnet-script
- NOTE: If you just installed .NET 5, restart the terminal. (Otherwise, you will not be able to run the following command.)
- Enter
$ dotnet script
in your terminal and a prompt will open:>
- To exit the REPL press: Ctrl +C
- Enter
- Install
- Clone the repository with the following git terminal command:
$ git clone https://github.com/BrianSturgis/JanWeek12Project.Solution.git
- Open the project directory in your terminal
- Navigate to the
Factory
directory- To create
obj
directories in both production and test projects, run the terminal command:$ dotnet restore
- NOTE: Do not touch the code in either
obj
directory.
- To create
- To launch the program, run the terminal command:
dotnet run
(Ensure you are in the project's root directory, Factory, in your Terminal/CMD before running these commands.)
- Create a file in the root directory of the project called "appsettings.json".
- Where you see "YOUR-PASSWORD-HERE" is where you put the password you created for your MySQL server. Your server name and port might vary depending on your local system. Check MySQL Workbench Connections to determine if the local host and port number match and adjust as needed. see example of file set up below.
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Port=3306;database=[YOUR_DATABASE];uid=root;pwd=[YOUR_PASSWORD];"
}
}
- Download MySQL Server. (Note: If you need additional assistance setting up MySQL, visit their site for further instructions.
- Download MySQL Workbench.
- Run dotnet ef migrations add Initial --> If there is an error stating "Unable to resolve project", this means the command wasn't run in the correct directory.
- Entity creates three files in the Migrations directory.
- Run the following command: dotnet ef database update.
email Brian Sturgis @ [email protected]
- C#
- NET
- VisualStudio Code
- Git
- GitHub
- MSTest
- coffee
- .NET 5
- ASP.NET Core
- Entity Framework
- MySQL Workbench 8.0.15
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE..
Copyright (c) 2020 Brian Micheal Sturgis