Video Game App is a web application developed using C#, ASP.NET Core MVC, and MySQL database. It employs Dapper as an ORM (Object-Relational Mapping) tool. The application allows users to perform CRUD (Create, Read, Update, Delete) operations on video games.
- Create: Add new video games to the database.
- Read: View details of existing video games.
- Update: Edit information about existing video games.
- Delete: Remove video games from the database.
- C#: Programming language used for application development.
- ASP.NET Core MVC: Framework for building web applications and APIs.
- MySQL: Relational database management system for storing video game data.
- Dapper: Lightweight ORM for data access.
- .NET SDK
- MySQL Server
- MySQL Workbench (optional, for database management)
- Visual Studio or any other C# IDE
-
Clone the Repository
git clone https://github.com/SethBowman/VideoGameMVC.git cd VideoGameMVC -
Setup MySQL Database
-
Install MySQL Server if not already installed.
-
Create a new database using the following SQL script:
-- Drop the existing database if it exists DROP DATABASE IF EXISTS video_games; -- Create a new database named video_games CREATE DATABASE video_games; USE video_games; -- Create the games table with genre, release_year, and platform columns CREATE TABLE games ( id INT AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255) NOT NULL, genre VARCHAR(100), release_year INT, platform VARCHAR(50), imgURL VARCHAR(255) ); -- Insert the specified games with titles, genre, release_year, platform, and image URLs INSERT INTO games (title, genre, release_year, platform, imgURL) VALUES ('The Legend of Zelda: Breath of the Wild', 'Action-Adventure', 2017, 'Nintendo Switch', 'https://upload.wikimedia.org/wikipedia/en/c/c6/The_Legend_of_Zelda_Breath_of_the_Wild.jpg'), ('God of War (2018)', 'Action-Adventure', 2018, 'PlayStation 4', 'https://upload.wikimedia.org/wikipedia/en/a/a7/God_of_War_4_cover.jpg'), ('Grand Theft Auto V', 'Action-Adventure', 2013, 'Multi-platform', 'https://upload.wikimedia.org/wikipedia/en/a/a5/Grand_Theft_Auto_V.png'), ('Minecraft', 'Sandbox', 2011, 'Multi-platform', 'https://upload.wikimedia.org/wikipedia/en/5/51/Minecraft_cover.png'), ('Overwatch', 'First-Person Shooter', 2016, 'Xbox One', 'https://upload.wikimedia.org/wikipedia/en/5/51/Overwatch_cover_art.jpg'), ('Cyberpunk 2077', 'Action RPG', 2020, 'Multi-platform', 'https://upload.wikimedia.org/wikipedia/en/9/9f/Cyberpunk_2077_box_art.jpg'), ('The Last of Us', 'Action-Adventure', 2013, 'PlayStation 3', 'https://upload.wikimedia.org/wikipedia/en/4/46/Video_Game_Cover_-_The_Last_of_Us.jpg'), ('Red Dead Redemption 2', 'Action-Adventure', 2018, 'Xbox One', 'https://upload.wikimedia.org/wikipedia/en/4/44/Red_Dead_Redemption_II.jpg'), ('The Elder Scrolls V: Skyrim', 'Action RPG', 2011, 'Multi-platform', 'https://upload.wikimedia.org/wikipedia/en/1/15/The_Elder_Scrolls_V_Skyrim_cover.png'); -- Query to check the inserted data SELECT * FROM games;
-
Create a
appsettings.jsonfile in the root directory of the project and add your MySQL connection string:{ "ConnectionStrings": { "DefaultConnection": "Server=your_server;Database=video_games;User=your_username;Password=your_password;" } }
-
-
Install Dependencies
dotnet restore
-
Run the Application
dotnet run
-
Open the Application
- Open a web browser and navigate to
http://localhost:5000to see the application in action.
- Open a web browser and navigate to
- Controllers: Contains the MVC controllers responsible for handling user requests.
- Models: Contains the data models representing video games.
- Views: Contains the Razor views for rendering HTML.
- Repositories: Contains the Dapper-based repository classes for data access.
- wwwroot: Contains static files like CSS, JS, and images.
- appsettings.json: Configuration file for application settings, including database connection strings.
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/YourFeature). - Create a new Pull Request.
For any inquiries or feedback, please reach out to [sbowman@truecoders.io].



