structid
OfficialGenerate safe typed IDs with zero runtime deps.
Software Engineering#EF Core#Dapper#source generator#struct ids#typed identifiers#JSON converters#C# record structs
Authordevlooped
Version1.0.0
Installs0
System Documentation
What problem does it solve?
StructId helps you avoid “stringly-typed” and loosely-typed identifier bugs by making every ID a distinct, strongly-typed value (as a readonly partial record struct), while keeping runtime dependencies at zero through source generation.
Core Features & Use Cases
- Strongly-typed identifiers: Define
IStructId(string-backed) andIStructId<TValue>(struct-backed) IDs usingreadonly partial record structso your compiler prevents mixing IDs accidentally. - Factories via INewable: Use
INewable<TSelf>/INewable<TSelf, TValue>for consistentNew(...)creation patterns (including parameterlessNew()forGuidandUlid-backed IDs). - Integration that “just activates”: Enable EF Core converters, Dapper type handlers, and System.Text.Json / Newtonsoft.Json converters automatically when you reference the corresponding packages.
- Template-based extension: Extend multiple (or filtered) ID types using
[TStructId]templates and specialized per-value-type handlers using[TValue].
Quick Start
Ask the AI: “Given I want a typed UserId(Guid) and a typed ProductId(int), show the two readonly partial record struct declarations using StructId and explain which New(...) overloads to call and how to enable EF Core and Dapper support.”
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: structid Download link: https://github.com/devlooped/StructId/archive/main.zip#structid Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.