NHibernate Session DI from StructureMap in components -


I know this is part of a horse, but I can not find a satisfactory answer. First let me know, I am not working with a web app, otherwise managing the NH session is quite simple.

I have some components of the enterprise, those components have their own service layer which will work on many repositories. For example:

  • Component of Claim
    • Claim Processing Service
    • Claim Collection
  • Billing component
    • Billing service
    • Billing repository
  • Policy element
    • Policy lock service
    • Policy repository
    • I want to write the services for injection with their required treasure (di) in the repositories should be an ihes or similar, to be injected I can under a Issn / Aitiaransakshn this operation.

      I know of the unit of work patterns and many samples, but none of these DI was displayed. I too have the streak of [threadstatic] because this material can also be used from WCF and I have described enough posts how to do it. I've read about professional conversations, but some simple things are required that each window / console app can easily bootstrap because we have these apps and some very inexperienced developers.

      So how can I inject the StructureMap from one application to the same parity in each dependent repository? The fully prepared and fully prepared example is without the use of SM (for clarity without clarification - please do not spend to criticize energy):

      Console Application

       using  main {using (Asunction session = GetSession ()) (ITransaction trans = session.BeginTransaction ()) {var policyRepo = New policy Repo (session); Var Policy Service = New Policy Service (Policy Rippo); Var billing repos = new billing repo (session) var billing service = new billing service (billing repo); Var Claims Repo = New Claims Repo (Session); Var Claims Service = New Claim Service (Pay Claim, Policy Service, Billing Service); ClaimService.FileCLaim (); Trans.Commit (); I found at the StructureMap for some posts, which can help some people I & nsquo;}  

Now SM with the WCF and NHBnet. How to use:


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -