Add Course entity and related migrations#20
Merged
JoeProgrammer88 merged 2 commits intomainfrom Oct 10, 2025
Merged
Conversation
Added a new `Course` entity with properties `Id`, `Title`, `CourseCode`, and `Description`, including validation and database constraints. Updated `ApplicationDbContext` to include a `DbSet<Course>` and configured `ApplicationUser` properties in `OnModelCreating`. Created migration `20251010012840_AddedCourse` to add the `Courses` table and migration `20251010013013_CourseDescriptionLength` to limit the `Description` column to 300 characters. Updated `ApplicationDbContextModelSnapshot` to reflect these changes. Added XML documentation for the `Course` class.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new Course entity to support course management functionality in the application. The changes add the Course model with proper validation constraints, create the necessary database tables through Entity Framework migrations, and integrate the entity into the application's data context.
- Added a Course entity with proper data annotations for validation and constraints
- Created two database migrations to establish the Courses table and enforce description length limits
- Updated the ApplicationDbContext to include the Course entity and modernized namespace syntax
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| SpeakingInBitsWeb/Models/Course.cs | Defines the Course entity with validation attributes and documentation |
| SpeakingInBitsWeb/Data/ApplicationDbContext.cs | Adds Course DbSet and updates namespace to file-scoped |
| SpeakingInBitsWeb/Data/Migrations/20251010012840_AddedCourse.cs | Initial migration creating the Courses table |
| SpeakingInBitsWeb/Data/Migrations/20251010013013_CourseDescriptionLength.cs | Follow-up migration adding 300-character limit to Description column |
| SpeakingInBitsWeb/Data/Migrations/ApplicationDbContextModelSnapshot.cs | Updated model snapshot reflecting the Course entity configuration |
Files not reviewed (2)
- SpeakingInBitsWeb/Data/Migrations/20251010012840_AddedCourse.Designer.cs: Language not supported
- SpeakingInBitsWeb/Data/Migrations/20251010013013_CourseDescriptionLength.Designer.cs: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5
This pull request introduces a new
Courseentity to the application and updates the database schema to support it. The changes include adding theCoursemodel to the Entity Framework context, creating the necessary database tables via migrations, and enforcing a maximum length constraint on the course description field.Entity and Database Schema Additions:
DbSet<Course>property to theApplicationDbContextclass, enabling Entity Framework to track and manageCourseentities.20251010012840_AddedCourse) that adds theCoursestable to the database, including columns forId,Title,CourseCode, andDescription. [1] [2]Schema Constraint Update:
20251010013013_CourseDescriptionLength) to enforce a maximum length of 300 characters on theDescriptioncolumn in theCoursestable.