AB#31104: Add RelatedEntitySubType to Contacts Table#1961
Merged
JamesPasta merged 5 commits intodevfrom Feb 3, 2026
Merged
Conversation
1 similar comment
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a contact relationship refactor by moving “contact-to-related-entity” fields off the Contacts table into a new ContactLinks table, along with associated EF Core model/migration updates and minor test cleanup.
Changes:
- Adds a new
ContactLinkdomain entity and maps it viaGrantTenantDbContext(newContactLinkstable + indexes). - Adds EF Core tenant migrations/snapshot updates for the new table and removal of relationship columns from
Contacts. - Updates contact type tests to remove LINQ usage; adds new repository interfaces for contacts.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| applications/Unity.GrantManager/test/Unity.GrantManager.Domain.Tests/Contacts/ContactTypeHelperTests.cs | Replaces LINQ FirstOrDefault with List.Find and removes System.Linq using. |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/TenantMigrations/GrantTenantDbContextModelSnapshot.cs | Updates the EF model snapshot to reflect the new ContactLinks entity/table and removed Contacts columns. |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/TenantMigrations/20260130175303_UpdateContacts.cs | Drops relationship columns from Contacts and creates the new ContactLinks table + indexes. |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/TenantMigrations/20260129171207_Add_RelatedEntitySubType_Column.cs | Adds RelatedEntitySubType to Contacts (but later removed by UpdateContacts). |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/TenantMigrations/20260129171207_Add_RelatedEntitySubType_Column.Designer.cs | EF migration designer snapshot for adding RelatedEntitySubType. |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/EntityFrameworkCore/GrantTenantDbContext.cs | Adds DbSet<ContactLink> and configures EF model mapping/indexes for ContactLinks. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Domain/Contacts/IContactRepository.cs | Adds a new contact repository interface. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Domain/Contacts/IContactLinkRepository.cs | Adds a new contact-link repository interface. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Domain/Contacts/ContactLink.cs | Introduces the ContactLink aggregate/entity. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Domain/Contacts/Contact.cs | Removes relationship fields from Contact. |
| applications/Unity.GrantManager/src/Unity.GrantManager.DbMigrator/Unity.GrantManager.DbMigrator.csproj | Adds a UserSecretsId to the migrator project. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...yFrameworkCore/Migrations/TenantMigrations/20260129171207_Add_RelatedEntitySubType_Column.cs
Show resolved
Hide resolved
applications/Unity.GrantManager/src/Unity.GrantManager.Domain/Contacts/IContactRepository.cs
Show resolved
Hide resolved
...ications/Unity.GrantManager/src/Unity.GrantManager.Domain/Contacts/IContactLinkRepository.cs
Show resolved
Hide resolved
...rantManager.EntityFrameworkCore/Migrations/TenantMigrations/20260130175303_UpdateContacts.cs
Show resolved
Hide resolved
...rantManager.EntityFrameworkCore/Migrations/TenantMigrations/20260130175303_UpdateContacts.cs
Show resolved
Hide resolved
...rantManager.EntityFrameworkCore/Migrations/TenantMigrations/20260130175303_UpdateContacts.cs
Outdated
Show resolved
Hide resolved
…rameworkCore/Migrations/TenantMigrations/20260130175303_UpdateContacts.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
JamesPasta
approved these changes
Feb 3, 2026
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.
No description provided.