{"id":23282260,"url":"https://github.com/nttlimitedrd/autofac.extras.versioning","last_synced_at":"2025-09-10T06:35:29.255Z","repository":{"id":23785211,"uuid":"27160660","full_name":"NTTLimitedRD/Autofac.Extras.Versioning","owner":"NTTLimitedRD","description":"Example of a versioned service locator using Autofac","archived":false,"fork":false,"pushed_at":"2014-11-26T05:36:52.000Z","size":196,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-26T21:12:27.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ksherb1/security-injections-3.0","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NTTLimitedRD.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":"2014-11-26T05:13:31.000Z","updated_at":"2014-11-26T05:36:52.000Z","dependencies_parsed_at":"2022-08-05T23:16:03.052Z","dependency_job_id":null,"html_url":"https://github.com/NTTLimitedRD/Autofac.Extras.Versioning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NTTLimitedRD/Autofac.Extras.Versioning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTTLimitedRD%2FAutofac.Extras.Versioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTTLimitedRD%2FAutofac.Extras.Versioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTTLimitedRD%2FAutofac.Extras.Versioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTTLimitedRD%2FAutofac.Extras.Versioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NTTLimitedRD","download_url":"https://codeload.github.com/NTTLimitedRD/Autofac.Extras.Versioning/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTTLimitedRD%2FAutofac.Extras.Versioning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274422322,"owners_count":25282124,"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-09-10T02:00:12.551Z","response_time":83,"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":[],"created_at":"2024-12-20T00:15:25.940Z","updated_at":"2025-09-10T06:35:29.217Z","avatar_url":"https://github.com/NTTLimitedRD.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Autofac.Extras.Versioning\n=========================\n\nExample of a versioned service locator using Autofac.\n\nYou can add an attribute to your constructors to specify the version of a dependency to be resolved from the container.\n\nWhen you register components. \n\nWhat, Why?\n==============\n\nLets say you want to run 2 implementations of a common service, e.g. \n\nIMyRestApiClient\n\nLet's say the implementations of IMyRestApiClient change, the vendor changes the API on you (not again!).\n\nBut, you have some existing code running on the old API and you want to take advantage of the new service methods.\n\nYou can register a MyRestApiClientv1 and MyRestApiClientv2 and specify the version for each component on registration.\n\nThen, when resolving using the constructor resolver you can specify the version for each required Interface. e.g.\n\n```\n\t\tpublic ExampleClass\n\t\t\t(\n\t\t\t\t[VersionedDependency(VersionRange.Version2)]\n\t\t\t\tIDependentInterface myInterface\n\t\t\t)\n\t\t{\n\t\t\tmyImplementation = myInterface;\n\t\t}\n```\nThis will make sure you get a component that was registered as being the implementation for Version1.\n\nTODO\n===========\n\nAdd an extension method for registering Versioned instead of using Keyed\u003cT\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnttlimitedrd%2Fautofac.extras.versioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnttlimitedrd%2Fautofac.extras.versioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnttlimitedrd%2Fautofac.extras.versioning/lists"}