structuremap | A Dependency Injection/Inversion of Control tool for .NET | Dependency Injection library
kandi X-RAY | structuremap Summary
kandi X-RAY | structuremap Summary
See instead the newer Lamar library as a replacement for StructureMap in new applications. I will continue to accept pull requests and try to answer questions, but there will be no new development on StructureMap unless someone else takes over project ownership. Welcome to StructureMap, the oldest Inversion of Control container for .Net.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of structuremap
structuremap Key Features
structuremap Examples and Code Snippets
Community Discussions
Trending Discussions on structuremap
QUESTION
I have following service class:
...ANSWER
Answered 2022-Jan-23 at 10:00I defined following Registry class in my WindowsForm project:
QUESTION
I'm struggling with StructureMap. I need to ensure that i get an instance per HttpContextLifecycle
but one for each constructor parameter. Our old working code was:
Registry:
...ANSWER
Answered 2021-Oct-29 at 12:52StructureMap by design will always build a fresh instance if you pass custom constructor parameters via ExplicitArguments
. You might want to use named instances instead like this:
QUESTION
I have following registration of the service:
...ANSWER
Answered 2021-Aug-24 at 11:51Your general logic is flawed. You expect things to run, even after your http call is already over.
Once you return a response, things happen in the ASP.NET framework.
Dependency injection containers finish their scope, objects get disposed.
Keeping those references that are probably scoped or transient in nature until after the call has completed is not going to work. Granted, sometimes it might work, when you have classes that do not implement IDisposable
or you just get lucky with a microsocond timing, but generally speaking, this is not anticipated and not meant to work.
If you want to do work after sending out the reply, you have to hand this work over to another party. Maybe you save it into a database and another service picks it up and works on it. Or maybe you have another program or thread running and you try some IPC. But you should not expect threads or tasks referencing things from the scope of your http call to work after it's done.
QUESTION
I am struggling with applying Data.Map.unions
to a list of Data.Map
singletons wrapped in an IO
. Here is my code:
ANSWER
Answered 2021-May-29 at 14:13The lambda expression:
QUESTION
I am creating sample project based on DDD.
- I created SharedKernel project where I have my class for DomainEvents
ANSWER
Answered 2021-Mar-08 at 12:06The first thing to do is to check out the type scanning diagnostics:
http://structuremap.github.io/diagnostics/type-scanning/.
The type scanning can be a little brittle if there are missing assemblies. The diagnostics might point out where things are going wrong. Also, try your WhatDoIHave()
diagnostics too.
And also, just making sure that you know that StructureMap is no longer supported and has been replaced by Lamar:
QUESTION
I have an old legacy system (more than 10 years) made in MVC 2 with structuremap(2.6.1.0) as DI. We have begun migrating the back with nHibernate (also 10 years old) to entity framework core in a standard library.
But this doesn't work so easy, this old structure map wants to map everything in standard library also and that wont work. I would need to make it ignore the standard library, any suggestion how I should do that?
...ANSWER
Answered 2021-Mar-22 at 18:05This cant be done. Structuremap doesn't support standard 2.0.. Went back to EF6 and will do the migration to EF core once the MVC is upgraded to core(and stucturemap is not needed in mvc2 anymore)
QUESTION
I get the following error in a .Net Framework project:
...ANSWER
Answered 2021-Jan-04 at 17:02Something in your Directory.Build.props has core depedencies, such as Castle.Core. Can you load in AspNetCore or drop the .core dependencies?
QUESTION
I have following class in my project:
...ANSWER
Answered 2020-Aug-22 at 07:12I used following code to solve the problem:
QUESTION
Is there an implementation of ISagaDbContextFactory for StructureMap? I've seen an implementation of AutofacSagaDbContextFactory for Autofac, and I would write my own for StructureMap, but I don't know what payload to look for to get an instance of the nested container that I would have expected masstransit to have created?? I tried the following with no luck
...ANSWER
Answered 2020-Apr-24 at 11:17You didn't specify which MassTransit version you were using, but the recommended way to set this up since MassTransit 6.1 is to use the AddDbContext
method in the container integration package (which should be MassTransit.StructureMap in your case). You can see an example here: https://masstransit-project.com/usage/sagas/efcore.html#container-integration.
Snippet from that webpage:
QUESTION
I have a bunch of data fetchers which all has the almost same signature. The only thing that differs is the return type. The return type is specified as T:
I have this interface:
...ANSWER
Answered 2020-Apr-23 at 12:19What we can do is introduce another interface for return type and all the types that will be returned will implement it.
Define an interface :
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install structuremap
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page