SimonCropp

Roslyn analyzer that prevents primitive ID values (Guid, int, string, etc.) from being crossed between domain types at compile time

19
0
100% credibility
Found Apr 24, 2026 at 19 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
C#
AI Summary

A code checker for .NET projects that prevents accidental mixing of ID values from different parts of your app during building, using simple labels without changing how your app runs.

How It Works

1
🔍 Spot sneaky ID mix-ups

While building your app with customers and orders, you realize simple numbers or codes for IDs are getting swapped, causing hard-to-find bugs.

2
📖 Discover the ID guardian

You learn about this helpful tool that watches your code and flags when IDs from different parts of your app don't match.

3
🛠️ Add the safety checker

With one easy step, you bring this smart watcher into your project to keep an eye on all your IDs.

4
🏷️ Label your IDs clearly

You add simple tags like 'Customer' to your ID spots, or just name them CustomerId so the tool understands automatically.

5
Build and get friendly alerts
✏️
Quick rename or tag

Change a name or add a tag right there with suggested fixes.

All good, keep going

Everything matches perfectly, so you move on confidently.

🛡️ IDs stay safe forever

Now your app catches ID mistakes before running, saving you from crashes and wrong data—your code feels rock-solid.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 19 to 19 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is StrongIdAnalyzer?

StrongIdAnalyzer is a C# Roslyn analyzer on GitHub that blocks primitive ID mixups—like feeding a Customer Guid into an Order param—at compile time. Slap [Id("Customer")] on properties, fields, or params, and it flags assignments, args, or equality checks crossing domains, using naming conventions for Id/XxxId to skip most attributes. Primitives stay primitives, so EF Core, JSON serializers, and ORMs need zero tweaks.

Why is it gaining traction?

No wrapper structs or generators means no ValueConverters, JsonConverters, or shared domain assemblies—perfect for decoupled services swapping Guids over boundaries. Incremental adoption shines: tag piecemeal, opt-in suffix inference grabs "Product" from sourceProductId if Product exists, code fixes add [Id] or rename on the fly. Plays nice with Rider, VS, Omnisharp, and Roslyn LSP via NuGet.

Who should use this?

C# backend devs with domain-heavy apps using Guid/int/string IDs, dodging runtime KeyNotFoundExceptions from silent swaps. Brownfield teams evaluating github roslyn analyzers for roslyn analyzer rules without big-bang refactors, or those unit-testing roslyn analyzers in dotnet projects.

Verdict

Strong pick for C# primitive ID safety—docs rival roslyn analyzer tutorials, tests cover edge cases like inheritance and LINQ. 19 stars and 1.0% credibility signal early days, but active milestones and benchmarks build trust. Install the NuGet if cross-domain bugs haunt you.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.