{"id":30710803,"url":"https://github.com/piotrstenke/durian","last_synced_at":"2026-04-02T02:06:55.603Z","repository":{"id":41541520,"uuid":"358701265","full_name":"piotrstenke/Durian","owner":"piotrstenke","description":"Durian is a collection of Roslyn-based analyzers and source generators that extend the default capabilities of C#.","archived":false,"fork":false,"pushed_at":"2025-01-08T14:35:38.000Z","size":5397,"stargazers_count":69,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-19T07:06:30.082Z","etag":null,"topics":["analysis","csharp","roslyn","roslyn-analyzer","source-generation"],"latest_commit_sha":null,"homepage":"","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/piotrstenke.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-16T19:34:18.000Z","updated_at":"2026-01-24T03:20:49.000Z","dependencies_parsed_at":"2025-04-17T10:31:28.099Z","dependency_job_id":"04d4591a-63ad-4b89-9ef9-1bbd825c693f","html_url":"https://github.com/piotrstenke/Durian","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/piotrstenke/Durian","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrstenke%2FDurian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrstenke%2FDurian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrstenke%2FDurian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrstenke%2FDurian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piotrstenke","download_url":"https://codeload.github.com/piotrstenke/Durian/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrstenke%2FDurian/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"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":["analysis","csharp","roslyn","roslyn-analyzer","source-generation"],"created_at":"2025-09-03T01:10:25.140Z","updated_at":"2026-04-02T02:06:55.577Z","avatar_url":"https://github.com/piotrstenke.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿\u003cdiv align=\"left\"\u003e\n\t\u003ca href=\"https://www.nuget.org/packages/Durian\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/nuget/v/Durian?color=seagreen\u0026style=flat-square\" alt=\"Version\"/\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://www.nuget.org/packages/Durian\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/nuget/dt/Durian?color=blue\u0026style=flat-square\" alt=\"Downloads\"/\u003e\n\t\u003c/a\u003e \u003cbr /\u003e\n\t\u003ca href=\"https://github.com/piotrstenke/Durian/actions\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/piotrstenke/Durian/dotnet.yml\" alt=\"Build\"/\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://github.com//piotrstenke/Durian/blob/master/LICENSE.md\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/github/license/piotrstenke/Durian?color=orange\u0026style=flat-square\" alt=\"License\"/\u003e\n\t\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\t\t\u003cimg src=\"img/icons/Durian-256.png\" alt=\"Durian logo\"/\u003e\n\u003c/div\u003e\n\n##\n\n**Durian is a collection of Roslyn-based analyzers, source generators and utility libraries that greatly extend the default capabilities of C# by bringing new features found in other existing programing languages, such as Kotlin, Swift, Java, C++, and many more.**\n\n## Table of Contents\n\n1. [Current State](#current-state)\n2. [Features](#features)\n\t1. [DefaultParam](#defaultparam)\n\t2. [InterfaceTargets](#interfacetargets)\n\t3. [FriendClass](#friendclass)\n\t4. [CopyFrom](#copyfrom)\n3. [In Progress](#in-progress)\n4. [Experimental](#experimental) \n\n## Current State\n\nDurian is still very much in development - many planned features are still not implemented or implemented only partially. Features that are production-ready are listed in the [Features](#Features) section below.\n\n## Features\n\nIf you seek more information about a specific feature, click on its name below.\n\n### [DefaultParam](src/Durian.DefaultParam/README.md)\n*DefaultParam* allows to specify a default type for a generic parameter.\n\n```csharp\nusing Durian;\n\npublic class Test\u003c[DefaultParam(typeof(string))]T\u003e\n{\n\tpublic T Value { get; }\n\n\tpublic Test(T value)\n\t{\n\t\tValue = value;\n\t}\n}\n\npublic class Program\n{\n\tstatic void Main()\n\t{\n\t\t// Test\u003cT\u003e can be used without type parameters - 'T' defaults to 'string'.\n\t\tTest test1 = new Test(\"\");\n\t\t\n\t\t// Type parameter can be stated explicitly.\n\t\tTest\u003cstring\u003e test2 = new Test\u003cstring\u003e(\"\");\n\t}\n}\n\n```\n\n### [InterfaceTargets](src/Durian.InterfaceTargets/README.md)\n\n*InterfaceTargets*, similar to how [System.AttributeUsageAttribute](https://docs.microsoft.com/en-us/dotnet/api/system.attributeusageattribute) works, allows to specify what kinds of types an interface can be implemented by.\n\n```csharp\nusing Durian;\n\n[InterfaceTargets(InterfaceTargets.Class)]\npublic interface ITest\n{\n}\n\n// Success!\n// ITest can be implemented, because ClassTest is a class.\npublic class ClassTest : ITest\n{\n}\n\n// Error!\n// ITest cannot be implemented, because StructTest is a struct, and ITest is valid only for classes.\npublic struct StructTest : ITest\n{\n}\n\n```\n\n### [FriendClass](src/Durian.FriendClass/README.md)\n\n*FriendClass* allows to limit access to 'internal' members by specifying a fixed list of friend types.\n\n```csharp\nusing Durian;\n\n[FriendClass(typeof(A))]\npublic class Test\n{\n\tinternal static string Key { get; }\n}\n\npublic class A\n{\n\tpublic string GetKey()\n\t{\n\t\t// Success!\n\t\t// Type 'A' is a friend of 'Test', so it can safely access internal members.\n\t\treturn Test.Key;\n\t}\n}\n\npublic class B\n{\n\tpublic string GetKey()\n\t{\n\t\t// Error!\n\t\t// Type 'B' is not a friend of 'Test', so it cannot access internal members.\n\t\treturn Test.Key;\n\t}\n}\n```\n\n### [CopyFrom](src/Durian.CopyFrom/README.md)\n\n*CopyFrom* allows to copy implementations of members to other members, without the need for inheritance. A regex pattern can be provided to customize the copied implementation.\n\n```csharp\nusing Durian;\n\n[CopyFromType(typeof(Other)), Pattern(\"text\", \"name\")]\npublic partial class Test\n{\n}\n\npublic class Other\n{\n\tprivate string _text;\n\n\tvoid Set(string text)\n\t{\n\t\t_text = text;\n\t}\n}\n\n// Generated\n\npartial class Test\n{\n\tprivate string _name;\n\n\tvoid Set(string name)\n\t{\n\t\t_name = name;\n\t}\n}\n\n```\n\n## In Progress\n\nThe following modules are still in active development and are yet to be released in a not-yet-specified future.\n\n## Experimental\n\nExperimental stage is a playground of sorts - modules included here are very early in development and there in no guarantee that they will be ever actually released.\n\n##\n\n*\\(Written by Piotr Stenke\\)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrstenke%2Fdurian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiotrstenke%2Fdurian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrstenke%2Fdurian/lists"}