structuremap Questions

3

Solved

I've been playing with the DI support in ASP.NET MVC RC2. I have implemented session per request for NHibernate and need to inject ISession into my "Unit of work" action filter. If I reference th...
Expedition asked 17/12, 2010 at 0:1

7

Solved

I'm using StructureMap at the moment, generally with convention-based (Scan()) auto-configuration, and I'm looking to add decorator-based caching into the pipeline. If I configure it manually that...
Constantina asked 10/2, 2010 at 8:6

3

Solved

I want to inject an instance into structuremap on the fly (i.e. outside of a registry/configuration) that lives for the life of the request. Currently I'm doing this in the HandleBeginRequest even...
Larisalarissa asked 29/3, 2011 at 15:29

2

I'm new to structureMap. How do I define constructor arguments for the following class with fluent configuration? Thanks public BlobContainer(CloudStorageAccount account , string containerName ...
Libbie asked 18/4, 2011 at 3:39

1

Solved

I have a plugin system that allows a user to choose the type of plugin they wish to create (basically this sets up a configuration for a plugin instance). They choose the plugin type from a select...
Topping asked 13/4, 2011 at 10:9

2

I'm building a REST API using ASP.NET MVC 3. I'm doing it BDD-style using SpecFlow with NUnit as test runner. Since it's a REST API, testing the Url:s are obviously very important so I want to be ...
Deign asked 28/2, 2011 at 16:50

2

Solved

I wanted to be sure if structuremap will dispose my DataContext after per request ends. Here is my setup ForRequestedType<MyDataContext>().TheDefault.Is.OfConcreteType<MyDataContext>(...
Apocope asked 16/2, 2011 at 10:38

2

Solved

When Controller1 is being created, I want that IService will be mapped to ConcreteService1 and IPageService to ConcretePageService1 And when Controller2 is created, I want that IService will be ma...
Mcgruder asked 14/2, 2011 at 13:30

2

I have a threadsafe object that is expensive to create and needs to be available through my application (a Lucene.Net IndexReader). The object can become invalid, at which point I need to recreate...
Creatural asked 9/2, 2011 at 17:53

0

I'm spiking a custom StructureMap ILifecycle with semantics similar to the SingletonLifecycle but with a predicate that must be met for the existing instance to be returned. The idea is that the c...
Geniculate asked 10/2, 2011 at 12:3

1

Solved

I have the following: public interface ICommand { } public class AddUser : ICommand { public string Name { get; set; } public string Password { get; set; } } public interface ICommandHandler&lt...
Engenia asked 19/1, 2011 at 9:7

4

Solved

Suppose i have a repository that returns a list of Posts. The repository interface has a GetAll() method which does what it suggests. Now in keeping with the theory that i shouldn't be putting dom...
Dissimulate asked 21/12, 2010 at 7:11

1

Solved

I'm new to StructureMap and have some existing code that I'm working with that uses StructureMap 2.5.4. There is a class that is constructed using StructureMap that has a constructor that takes IE...
Pewee asked 12/1, 2011 at 4:49

1

It seems like NLog can't use reflection for GetCurrentClassLogger(), even though my MVC 3 app is deployed in a Full Trust environment on IIS7. I'm using StructureMap 2.6.1 and the problem seems to ...

3

Solved

I'm using StructureMap to resolve references to my repository class. My repository interface implements IDisposable, e.g. public interface IMyRepository : IDisposable { SomeClass GetById(int id);...
Venipuncture asked 19/12, 2010 at 15:37

2

Solved

I hawe all day strugle my head and i canot find any solution to my case so i nead help. Hear is my problem: I hawe two classes that implement one interface public interface ICacheObject { string...
Anetta asked 19/10, 2010 at 6:48

1

How to do Dependency Injection on Property of a class Using Structure Map public class ContactController : Controller { public IContactService Service { get; set; } public ContactController() ...
Jeweller asked 16/10, 2010 at 22:37

2

Solved

I'm trying to get Property Injection working on a Custom Action Filter Attribute. It is working as it is supposed to, however, I'd like to use DI on the Property itself. My filter looks like this ...
Crosspatch asked 6/10, 2010 at 20:8

1

I use this approuch http://www.kevinwilliampang.com/2010/04/06/setting-up-asp-net-mvc-with-fluent-nhibernate-and-structuremap/ for setting up fnh with structuremap but after one request I get the f...
Pantheon asked 30/9, 2010 at 17:34

1

Solved

Ok, I give up... What I want is to share the EF4's DbContext instance per request. I configured StructureMap like this: For<MyContext>().Use(new MyContext("LocalhostConnString")); But whe...
Removable asked 10/9, 2010 at 22:0

3

Solved

If i have the following Repository: public IQueryable<User> Users() { var db = new SqlDataContext(); return db.Users; } I understand that the connection is opened only when the query is...

3

I work in a VB.Net environment and have recently been tasked with creating an MVC environment to use as a base to work from. I decided to convert the latest SharpArchitecture release (Q3 2009) into...

1

Solved

I'm using a wrapper for the ASP.NET Membership provider so that I can have more loosely coupled usage of the library. I'm wanting to use StructureMap to provide true IoC, but I'm having trouble wit...
Sprue asked 28/6, 2010 at 18:33

3

Solved

I am early in development on a new ASP.Net MVC project and I using this project to get into DI. I'm pretty sure that I am going to go with Structure Map, but that isn't what I am asking about. What...

1

Solved

Simply, what is the difference between HybridHttpOrThreadLocalScoped & HttpContextScoped?
Hudgens asked 10/6, 2010 at 11:49

© 2022 - 2024 — McMap. All rights reserved.