{"id":27013513,"url":"https://github.com/lamparter/ideconstructable","last_synced_at":"2026-04-29T16:09:01.423Z","repository":{"id":285762607,"uuid":"959257306","full_name":"Lamparter/IDeconstructable","owner":"Lamparter","description":"Exposes the IDeconstructable interface and its source generator to allow \"deconstructing\" classes into their fields.","archived":false,"fork":false,"pushed_at":"2025-04-02T17:03:33.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T02:02:08.629Z","etag":null,"topics":["constructor","csharp","dependencyinjection","dotnet","riverside","riversidevalley","roslyn","roslyn-generator","source-generator"],"latest_commit_sha":null,"homepage":"https://nuget.org/packages/Riverside.DeconstructableInterfaces","language":"C#","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/Lamparter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-02T13:54:25.000Z","updated_at":"2025-04-03T04:44:45.000Z","dependencies_parsed_at":"2025-04-02T15:24:00.914Z","dependency_job_id":"4bc3a008-589a-41fb-a415-ca9a6690a6e0","html_url":"https://github.com/Lamparter/IDeconstructable","commit_stats":null,"previous_names":["lamparter/ideconstructable"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lamparter/IDeconstructable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamparter%2FIDeconstructable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamparter%2FIDeconstructable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamparter%2FIDeconstructable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamparter%2FIDeconstructable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lamparter","download_url":"https://codeload.github.com/Lamparter/IDeconstructable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lamparter%2FIDeconstructable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32433068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["constructor","csharp","dependencyinjection","dotnet","riverside","riversidevalley","roslyn","roslyn-generator","source-generator"],"created_at":"2025-04-04T12:29:44.536Z","updated_at":"2026-04-29T16:09:01.402Z","avatar_url":"https://github.com/Lamparter.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [`Riverside.DeconstructableInterfaces`](https://nuget.org/packages/Riverside.DeconstructableInterfaces)\n\n\u003e Exposes the IDeconstructable interface and its source generator to allow \"deconstructing\" classes into their fields.\n\n---\n\nThis library exposes an `IDeconstructable` interface that lets you 'deconstruct' classes into their fields.\n\nFor example:\n```cs\npublic partial class MyClass : IDeconstructable\u003cField1, Field2\u003e\n{\n    public MyClass()\n    {\n        Field1 = string.Empty;\n        Field2 = \"Hello World\";\n    }\n    public string Field1;\n    public string Field2;\n}\n```\n\nThis will then source generate a method in `MyClass`:\n```cs\n/// \u003cauto-generated/\u003e\npublic partial class MyClass : IDeconstructable\u003cField1, Field2\u003e\n{\n    public (string, string) Deconstruct()\n        =\u003e (Field1, Field2)\n}\n```\n\nThis has many use cases, including:\n- JSON serialisation so containing serialisation types can be split\n  - This might be useful when moving from reflection-based serialisation with anonymous types to source-generated serialisation\n- Reducing dependency on class references or 'saving' a class's volatile data into a constant variable\n\n..and just for fun! This project is a learning experience for making simple incremental source generators.\nI came up with the idea for this when migrating [Taskie](https://github.com/shef3r/Taskie) to modern UWP with .NET 9 (on Native AOT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamparter%2Fideconstructable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamparter%2Fideconstructable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamparter%2Fideconstructable/lists"}