This is my repository for class work!
For my website project I built a small ASP.NET Core MVC website called The Learning Center.
The website uses a simple SQL Express database with 3 tables:
- Class to store information about classes
- User to store information about users
- UserClass to store the relationship of a user being registered for a class.
The index page serves as the starting point for the website. The navigation bar at the top-right corner of the page changes to display a user's name if they are signed in.
This page allows the user to enroll in a new account, with some basic user input validation. I did not use the default ASP.NET identity solution, I used a custom one.
This page allows an existing user to log in. I had a few challenges trying to get the [Authorize] attribute to successfully redirect the user to this log in page.
This was the screen to display the information on all of the available classes. The user does not need to be authenticated to see this page. All of the class information in the table is pulled from the SQL express database.
This page allows the user to register for a class. The user needs to be authenticated for enrollment to work correctly, so the user must be logged in to visit this page.
This page allows a currently logged in user to view the classes that they are currently enrolled in. In order to view all of this data in one screen, I needed to create a custom model, which combines data elements from two models. The ClassModel contains all of the detailed information about the classes themselves, like Name and Description and Price. The EnrollModel contains the relationship between a student, and the class they are enrolled in. I built a custom model called UserEnrolledClassesViewModel that brings many of these elements together so that they can be displayed together in a single view.
The goal of this project was to create a REST web service for a user object.
- User ID (Auto-generated guid)
- User Email (Required field)
- User Password (Required field)
- Note (Optional text field)
- Created date (Service generated date)
Return 201 Created if the user was created successfully.
Return a 200 OK if the user was updated successfully.
Get all current users.
Return the user if they were found.
Return 200 if the user was deleted or 404 if the user was not found.