{"id":23112936,"url":"https://github.com/vbfox/stidgen","last_synced_at":"2025-08-12T17:40:53.492Z","repository":{"id":30084014,"uuid":"33633628","full_name":"vbfox/stidgen","owner":"vbfox","description":"Generate Strongly Typed Id types in C#","archived":false,"fork":false,"pushed_at":"2021-04-17T15:01:27.000Z","size":580,"stargazers_count":11,"open_issues_count":13,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-01T04:48:20.876Z","etag":null,"topics":["code-generation","csharp"],"latest_commit_sha":null,"homepage":"","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vbfox.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2015-04-08T21:38:40.000Z","updated_at":"2021-04-17T15:01:29.000Z","dependencies_parsed_at":"2022-07-16T13:00:27.755Z","dependency_job_id":null,"html_url":"https://github.com/vbfox/stidgen","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/vbfox/stidgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vbfox","download_url":"https://codeload.github.com/vbfox/stidgen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fstidgen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270108299,"owners_count":24528758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","csharp"],"created_at":"2024-12-17T02:21:06.771Z","updated_at":"2025-08-12T17:40:53.451Z","avatar_url":"https://github.com/vbfox.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Strongly Typed ID type Generator\r\n================================\r\n\r\n[![Github Actions Status](https://github.com/vbfox/stidgen/actions/workflows/main.yml/badge.svg)](https://github.com/vbfox/stidgen/actions/workflows/main.yml?query=branch%3Amaster)\r\n[![Nuget Package](https://img.shields.io/nuget/v/stidgen.svg)](https://www.nuget.org/packages/stidgen)\r\n\r\nThis tool uses simple text files as input like :\r\n\r\n\tpublic Corp.Product.UserId\u003cstring\u003e\r\n\r\n    public Corp.Product.TweetId\u003clong\u003e\r\n        EqualsUnderlying: true\r\n\r\nAnd generate for each type specified a type that can be used as a strongly-typed ID:\r\n\r\n* It's an immutable value type with a single member.\r\n* The `struct` is partial to allow addition of methods and properties.\r\n* `null` values are disallowed by default and an extensibility point is available to add more application-dependent checks.\r\n* Casts from and to the underlying type are available. (explicit by default)\r\n* Equality member and operators are lifted, by default the ID types are only equals between themselves but equality with the underlying type is can be enabled with `EqualsUnderlying` setting.\r\n* `IEquatable\u003cT\u003e` is implemented.\r\n* `IConvertible` is implemented if the underlying type implement it.\r\n* `IComparable\u003cId\u003e` is implemented if `IComparable\u003cUnderlying\u003e` is implemented by the underlying type.\r\n* Other `IComparable\u003cT\u003e` implementations are lifted if `EqualsUnderlying` is set.\r\n* `string` IDs are interned by default.\r\n\r\nExamples of generated files can be found in the [sample folder](https://github.com/vbfox/stidgen/tree/master/samples).\r\n\r\nInstallation\r\n------------\r\n\r\nThe recommended way is via paket or nuget.\r\n\r\nFor nuget :\r\n\r\n    nuget install stidgen -ExcludeVersion -OutputDirectory packages\r\n\r\nFor paket, add `nuget stidgen` to your `paket.dependencies` and then to\r\ninstall it :\r\n\r\n    /.paket/paket.exe install\r\n\r\nA **zip** file containing the latest released version can also be found in\r\nthe [latest GitHub release](https://github.com/vbfox/stidgen/releases/latest).\r\n\r\nUsage\r\n-----\r\n\r\nThen to generate all files specified by a stidgen definition file :\r\n\r\n    ./packages/stidgen/tools/stidgen.exe myfile.stidgen\r\n\r\nDefinition file format\r\n----------------------\r\n\r\nEach definition file can contain a number of types of the form :\r\n\r\n    public|internal [Namespace.]TypeName\u003cUnderlyingType\u003e\r\n        PropertyA: value\r\n        PropertyB: value\r\n\r\n### Properties :\r\n\r\n* **ValueProperty** (string): Specify the name of the property containing the underlying value. Default to \"Value\".\r\n* **AllowNull** (bool): Allow null underlying values (only applies if the underlying type is a reference type). Default to false.\r\n* **InternString** (bool): Intern string underlying values (only applies if the underlying type is `string`. Default to true.\r\n* **EqualsUnderlying** (bool): Make the underlying be equal to the Id type when Equals, CompareTo and == are called.\u003cbr/\u003e\r\nAlso implements `IEquatable\u003cUnderlying\u003e` and `IComparable\u003cUnderlying\u003e` on the id type.\r\n* **CastToUnderlying** (\"explicit\" or \"implicit\"): Specify how is generated the cast from the id type to the underlying type. Default to \"explicit\".\r\n* **CastFromUnderlying** (\"explicit\" or \"implicit\"): Specify how is generated the cast from the underlying type to the id type. Default to \"explicit\".\r\n* **FileName** (string): Full name of the file to generate for this type. Default to \"TypeName.Generated.cs\".\r\n* **ProtobufnetSerializable** (bool): Enable the generation of `[ProtoContract]` and `[ProtoMember]` attributes for [protobuf-net](https://github.com/mgravell/protobuf-net) support. Default to false.\r\n\r\n\r\n[LicenseBadge]: https://img.shields.io/badge/license-MIT%20License-blue.svg\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbfox%2Fstidgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvbfox%2Fstidgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbfox%2Fstidgen/lists"}