title: StructureMap error when use with MVC in constructor
body: <p>When I install <a href="https://www.nuget.org/packages/StructureMap-MVC3" rel="nofollow">StructureMap</a> for my project and use:</p>
  
  <pre><code>public class IndexController : Controller
      {
          private readonly IMapper&lt;UserModel, UserDto&gt; _mapper;
  
          public IndexController(IMapper&lt;UserModel, UserDto&gt; mapper)
          {
              _mapper = mapper;
          }
  
          public ActionResult Index()
          {
              List&lt;UserDto&gt; userDb = UserDb.GetAll();
              UserModel userModel = _mapper.Map(userDb[0]);
              return View();
          }
      }
  </code></pre>
  
  <p>After run with an server error message:</p>
  
  <blockquote>
    <p>No parameterless constructor defined for this object. Description: An
    unhandled exception occurred during the execution of the current web
    request. Please review the stack trace for more information about the
    error and where it originated in the code.
             Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.
        ...</p>
  </blockquote>
  
  <p>But I don't know much about the principle of dependency inversion. Please help me to resolve this.</p>
  
  <p>This is <code>ObjectFactory</code> :</p>
  
  <pre><code>public static class IoC {
          public static IContainer Initialize() {
              ObjectFactory.Initialize(x =&gt;
                          {
                              x.Scan(scan =&gt;
                                      {
                                          scan.TheCallingAssembly();
                                          scan.WithDefaultConventions();
                                      });
              //                x.For&lt;IExample&gt;().Use&lt;Example&gt;();
                          });
              return ObjectFactory.Container;
          }
      }
  </code></pre>
  
  <p>What do I need to do next? </p>