SSWConsulting / SSWConsulting/SSW.CleanArchitecture
🐛 Investigate use of Nullable Strongly Typed IDs
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 199
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
The problem I've found is that sometimes you need to use optional/nullable foreign keys. When you do this EF Core doesn't like trying to use nullable structs for FKs. The only way I could find to fix this is to change from a record struct to record.
Should probably create a ticket to further investigte this and update the rule if necesary.
See usages of TeamId for more details.
If needed update the rule - https://www.ssw.com.au/rules/do-you-use-strongly-typed-ids/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the TeamId usages referenced in the issue, focusing on nullable foreign-key scenarios and the difference between record struct and record. Determine whether the strongly typed ID rule needs changing, then update the linked SSW rule if the investigation confirms it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100