{"id":13430716,"url":"https://github.com/Keboo/AutoDI","last_synced_at":"2025-03-16T06:30:58.403Z","repository":{"id":46517540,"uuid":"63395197","full_name":"Keboo/AutoDI","owner":"Keboo","description":"Dependency injection made simple.","archived":false,"fork":false,"pushed_at":"2023-05-22T15:02:21.000Z","size":4837,"stargazers_count":96,"open_issues_count":18,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-17T17:57:01.398Z","etag":null,"topics":["dependency-injection","dependency-resolution","di-container","fody","hacktoberfest","ilweaving"],"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/Keboo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2016-07-15T05:50:37.000Z","updated_at":"2024-09-12T09:53:57.000Z","dependencies_parsed_at":"2024-01-05T20:52:20.613Z","dependency_job_id":"35bc36c3-ba1a-4300-894c-d361329dd569","html_url":"https://github.com/Keboo/AutoDI","commit_stats":{"total_commits":422,"total_committers":16,"mean_commits":26.375,"dds":"0.39573459715639814","last_synced_commit":"a9cb11d641f434d59c4c384ae9be57c21af234de"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keboo%2FAutoDI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keboo%2FAutoDI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keboo%2FAutoDI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keboo%2FAutoDI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Keboo","download_url":"https://codeload.github.com/Keboo/AutoDI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221656349,"owners_count":16858752,"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":["dependency-injection","dependency-resolution","di-container","fody","hacktoberfest","ilweaving"],"created_at":"2024-07-31T02:00:57.056Z","updated_at":"2024-10-27T09:30:36.353Z","avatar_url":"https://github.com/Keboo.png","language":"C#","readme":"# AutoDI\nHave a question? [![Join the chat at https://gitter.im/AutoDIContainer/Lobby](https://badges.gitter.im/AutoDIContainer/Lobby.svg)](https://gitter.im/AutoDIContainer/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![NuGet Status](http://img.shields.io/nuget/v/AutoDI.svg?style=flat\u0026label=AutoDI)](https://www.nuget.org/packages/AutoDI/)\n[![NuGet Status](http://img.shields.io/nuget/v/AutoDI.Build.svg?style=flat\u0026label=AutoDI.Build)](https://www.nuget.org/packages/AutoDI.Build/)\n[![NuGet Status](http://img.shields.io/nuget/v/AutoDI.AspNetCore.svg?style=flat\u0026label=AutoDI.AspNetCore)](https://www.nuget.org/packages/AutoDI.AspNetCore/)\n\n![Build Status](https://github.com/Keboo/AutoDI/workflows/.NET%20Core/badge.svg?branch=master)\n\n\nAutoDI is both a dependency injection container and a framework to simplify working with dependency injection (DI). It is built on top of the [Microsoft.Extensions.DependencyInjection.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection.Abstractions/) library, and it works very similar to [the way ASP.NET Core handles dependency injection](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection).\n\nAutoDI delivers delivers two excellent features:\n1. It is built on [Microsoft.Extensions.DependencyInjection.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection.Abstractions/) library to bring the same flavor of dependency injection enjoyed on ASP.NET Core to other platforms (.NET Framework, WPF, Xamarin, UWP, etc). \n2. It generates container registrations _at compile time_ using conventions (of course you can also add more at run-time as well).\n\nSee the [wiki](https://github.com/Keboo/AutoDI/wiki) for more details or check out the [Quick Start](https://github.com/Keboo/AutoDI/wiki/Quick-Start) page to get up and running fast.\n\n\n## Why do I need this?\n\nThe goal of this library is to make dependency injection as simple as adding a NuGet package. \n\nIn addition to standard constructor dependency injection, it also allows optional constructor parameters that will be resolved when the constructor is invoked.\n\nIn a typical DI setup, you can often find objects needing to take in dependencies that the object itself is not using, but needs them to pass into some other object. The bigger and deeper the object model gets, the worse this becomes. \nAs a specific example, imagine you are inside of class `Foo` and wish to create an instance of `Bar`, but `Bar` has a dependency on `IService`. \nIn many cases, one of several options can be used:\n* Pass a facade to either the DI container or a factory that can create a `Bar`\n* Add a dependency on `Foo` to take in an `IService` so that when it needs to create a `Bar` it can simply pass the instance to `Bar`'s constructor.\n\nThough both these options work, they add additional effort. After all, in many cases, when we want a `Bar` we simply call `new Bar();`. AutoDI lets you write exactly that, and moves the dependency resolution inside of `Bar`'s constructor.\nThis dependency resolution is then forwarded to the DI container to resolve it.\n\n\n## Does it work with \u003cmy favorite DI container / framework\u003e?\nProbably. \nTake a look at the [AutoDI.Examples](https://github.com/Keboo/AutoDI.Examples) repository for samples. There are examples of adding support for other DI containers as well as simple examples for most frameworks.\n\n*Don't see your favorite listed? I accept PRs.*\n\n### Icon\n\u003cimg src=\"https://raw.github.com/Keboo/AutoDI/master/Icons/needle.png\" width=\"64\"\u003e\n\n[Needle](https://materialdesignicons.com/icon/needle) designed by [Austin Andrews](https://thenounproject.com/prosymbols/) from [Material Design Icons](https://materialdesignicons.com/)\n","funding_links":[],"categories":["Frameworks, Libraries and Tools","框架, 库和工具","IOC"],"sub_categories":["IOC","控制反转IOC"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKeboo%2FAutoDI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKeboo%2FAutoDI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKeboo%2FAutoDI/lists"}