{"id":22980491,"url":"https://github.com/kcartlidge/csharp-interface-implementation-locator","last_synced_at":"2025-04-02T09:40:20.763Z","repository":{"id":145848170,"uuid":"41570781","full_name":"kcartlidge/CSharp-Interface-Implementation-Locator","owner":"kcartlidge","description":"Fetches all current-asembly implementations of a given interface dynamically without needing full-blown IOC containers.","archived":false,"fork":false,"pushed_at":"2015-08-28T21:56:12.000Z","size":188,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T00:41:28.518Z","etag":null,"topics":["csharp","ioc"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kcartlidge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-28T21:51:27.000Z","updated_at":"2017-09-15T18:56:39.000Z","dependencies_parsed_at":"2023-04-06T11:23:28.704Z","dependency_job_id":null,"html_url":"https://github.com/kcartlidge/CSharp-Interface-Implementation-Locator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcartlidge%2FCSharp-Interface-Implementation-Locator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcartlidge%2FCSharp-Interface-Implementation-Locator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcartlidge%2FCSharp-Interface-Implementation-Locator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcartlidge%2FCSharp-Interface-Implementation-Locator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kcartlidge","download_url":"https://codeload.github.com/kcartlidge/CSharp-Interface-Implementation-Locator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246792391,"owners_count":20834920,"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","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":["csharp","ioc"],"created_at":"2024-12-15T01:43:42.225Z","updated_at":"2025-04-02T09:40:20.737Z","avatar_url":"https://github.com/kcartlidge.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C# Interface Implementation Locator\nFetches all current-asembly implementations of a given interface dynamically without needing full-blown IOC containers.\n\nDependency injection is great. You know, inversion of control, constructor injection and all the other buzzwords.\n\nSometimes however it can be overkill.\n\nI recently knocked up a tool that, having no UI and just a progress indicator, was ideally suited to a console application. One of the things it did was to create an export in a variety of formats (text, RTF and EPUB). I wanted it to be easy to add new export implementations, ideally without needing setup code.\n\nNaturally I coded to an interface (*IGenerator*) and all the exporters implemented it. What I needed was a way to gather all things that implement that interface and run them in turn, in such a way that if new ones were added they were automatically picked up (the nature of the code meant that an actual IOC container setup was not needed).\n\nThis is the class I created, and it's called like so:\n\n``` c#\nstatic List\u003cIGenerator\u003e generators = ImplementationLocator.GetImplementations\u003cIGenerator\u003e();\n```\n\nIts return value is a collection of actual instances of each implementation that I can call like this:\n\n``` c#\nforeach (var generator in generators) generator.Generate(document, folder);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcartlidge%2Fcsharp-interface-implementation-locator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcartlidge%2Fcsharp-interface-implementation-locator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcartlidge%2Fcsharp-interface-implementation-locator/lists"}