Tuesday 2 November 2010

Using Automapper with Windsor

It took me a little while to track this down so I’m posting it here.  If you have resolvers that need DI you can get Automapper to use Windsor using the below.

   1:  Mapper.Initialize(x => x.ConstructServicesUsing(_container.Resolve));


That’s it.  Automapper will now use Windsor for object construction.

Saturday 16 January 2010

WCF with out a codefile

I’m always forgetting this.  If you want to use wcf using an assembly instead of a code file here is what you have to do.

  1. Add the assembly as a reference.
  2. change the svc file mark up to
       1: <%@ ServiceHost Service="<Concrete Class>"  %>





  3. Change the service configuration in the web.config





       1: <service behaviorConfiguration="tricoder_serviceBehavior" name="<Concrete Class">



       2:   <endpoint address="" binding="basicHttpBinding" bindingConfiguration=""



       3:    contract="Interface with contracts" >



       4:   </endpoint>



       5:   <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />



       6:  </service>



       7: </services>










    And make sure that you use the full name of the concrete class and the interface.




    Technorati Tags: ,