{"id":21432571,"url":"https://github.com/jamesrandall/accidentalfish.xamarin.dependencyinjection","last_synced_at":"2025-06-13T23:33:52.876Z","repository":{"id":11134274,"uuid":"13497989","full_name":"JamesRandall/AccidentalFish.Xamarin.DependencyInjection","owner":"JamesRandall","description":"Code generating dependency injector for Xamarin","archived":false,"fork":false,"pushed_at":"2013-10-11T17:22:46.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T08:43:21.280Z","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":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesRandall.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}},"created_at":"2013-10-11T12:08:42.000Z","updated_at":"2013-10-11T17:22:46.000Z","dependencies_parsed_at":"2022-09-04T06:21:50.947Z","dependency_job_id":null,"html_url":"https://github.com/JamesRandall/AccidentalFish.Xamarin.DependencyInjection","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/JamesRandall%2FAccidentalFish.Xamarin.DependencyInjection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesRandall%2FAccidentalFish.Xamarin.DependencyInjection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesRandall%2FAccidentalFish.Xamarin.DependencyInjection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesRandall%2FAccidentalFish.Xamarin.DependencyInjection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesRandall","download_url":"https://codeload.github.com/JamesRandall/AccidentalFish.Xamarin.DependencyInjection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945321,"owners_count":20372890,"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":[],"created_at":"2024-11-22T23:19:06.466Z","updated_at":"2025-03-16T22:35:41.183Z","avatar_url":"https://github.com/JamesRandall.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Code Generated IoC\n==================\n\nThis is a simple dependency injector for Xamarin.iOS with a twist - it can generate C# code and cut out all the nasty reflection business associated with most AoT compiler compatible injection containers.\n\nIt's a little scrappy at the moment and checked in quite early to allow a friend to use it - as such there are probably quite a few bugs.\n\nTo use it during development simple create a new instance of the Container class and it supports the usual set of Register\u003c\u003e and Resolve\u003c\u003e type methods.\n\nWhen you're ready create an instance of the CodeGenerator class and use the WriteToStream method to generate a C# class with your dependencies created by compilable code as opposed to reflection.\n\nThe tests in CsharpGeneratorTests.cs show how to do this. I'll make getting the code easier in a future version for now the easiest way is simply to grab the resulting string in the Xamarin IDE Locals inspector and paste it into a new file.\n\nIn the current version Instance registrations are not supported in the generated code though I am planning on adding support for them in a future release via a couple of mechanisms.\n\nAdditionally if you've used internals for your dependency implementations you will need to make them visibly to the assembly that contains the container (assuming it's in a different assembly). I've got some ideas about this for a future version (chained / nested containers).\n\nTestContainer.cs is a good example of a code generated container.\n\nThe code is licensed under the MIT License so you can use it in commercial projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesrandall%2Faccidentalfish.xamarin.dependencyinjection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesrandall%2Faccidentalfish.xamarin.dependencyinjection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesrandall%2Faccidentalfish.xamarin.dependencyinjection/lists"}