{"id":22519661,"url":"https://github.com/cocowalla/hangfire.structuremap","last_synced_at":"2025-08-03T18:32:45.272Z","repository":{"id":23299570,"uuid":"26658926","full_name":"cocowalla/Hangfire.StructureMap","owner":"cocowalla","description":"Hangfire background job activator based on the StructureMap IoC container","archived":false,"fork":false,"pushed_at":"2022-06-28T14:01:52.000Z","size":723,"stargazers_count":17,"open_issues_count":0,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-06T20:15:34.599Z","etag":null,"topics":["dependency-injection","hangfire","ioc","structuremap"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cocowalla.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":"2014-11-14T21:46:23.000Z","updated_at":"2022-11-02T20:20:56.000Z","dependencies_parsed_at":"2022-08-21T15:20:33.913Z","dependency_job_id":null,"html_url":"https://github.com/cocowalla/Hangfire.StructureMap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocowalla%2FHangfire.StructureMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocowalla%2FHangfire.StructureMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocowalla%2FHangfire.StructureMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocowalla%2FHangfire.StructureMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cocowalla","download_url":"https://codeload.github.com/cocowalla/Hangfire.StructureMap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228560784,"owners_count":17937135,"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","hangfire","ioc","structuremap"],"created_at":"2024-12-07T04:25:41.671Z","updated_at":"2024-12-07T04:25:42.249Z","avatar_url":"https://github.com/cocowalla.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hangfire.StructureMap\n=====================\n\n[![Windows Build Status](https://img.shields.io/appveyor/ci/cocowalla/hangfire-structuremap.svg?label=Windows%20Build)](https://ci.appveyor.com/project/cocowalla/hangfire-structuremap)\n[![Linux Build status](https://img.shields.io/travis/cocowalla/Hangfire.StructureMap.svg?label=Linux%20Build)](https://travis-ci.org/cocowalla/Hangfire.StructureMap)\n[![NuGet](https://img.shields.io/nuget/v/Hangfire.StructureMap.svg)](https://www.nuget.org/packages/Hangfire.StructureMap)\n\nThis package provides [StructureMap](http://structuremap.github.io/) support for [Hangfire](http://hangfire.io), allowing nested StructureMap containers to resolve job type instances and their dependencies, and to manage the lifetime of resolved instances.\n\nGetting started\n---------------\n\nInstall the [Hangfire.StructureMap](https://www.nuget.org/packages/Hangfire.StructureMap) package from NuGet:\n\n```powershell\nInstall-Package Hangfire.StructureMap\n```\n\nTo configure Hangfire to use StructureMap, configure your container and call the `IGlobalConfiguration` extension method, `UseStructureMapActivator`:\n\n```csharp\nvar container = new Container();\n// container.Configure...\n\nGlobalConfiguration.Configuration.UseStructureMapActivator(container);\n```\n\nAfter configuration, when jobs are started a StructureMap-based implementation of the `JobActivator` class is used to resolve job type instances and all of their dependencies.\n\nObject Lifecycles\n-----------------\n\n*Hangfire.StructureMap* doesn't rely on a specific object lifecycle - you can configure your dependencies as `Singleton`, `ContainerScoped`, `Transient`, `AlwaysUnique` or `ThreadLocal` as normal.\n\n*Hangfire.StructureMap* creates a [*nested container*](http://structuremap.github.io/the-container/nested-containers/) for each job execution, so using `ContainerScoped` will scope dependency lifetimes to that of the job.\n\n```csharp\ncontainer.For\u003cIRepository\u003e().ContainerScoped().Use\u003cGenericRepository\u003e();\n```\n\nThe nested container is disposed when jobs ends, and all dependencies that implement the `IDisposable` interface are also automatically disposed  (`Singleton` scoped instances are of course an exception).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocowalla%2Fhangfire.structuremap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcocowalla%2Fhangfire.structuremap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocowalla%2Fhangfire.structuremap/lists"}