Injecting Dependencies into Domain Model classes with Nhibernate (ASP.NET MVC + IOC)

后端 未结 4 2216

I\'m building an ASP.NET MVC application that uses a DDD (Domain Driven Design) approach with database access handled by NHibernate. I have domain model class (Administrator) th

4条回答
  •  走了就别回头了
    2021-02-09 11:07

    There are already similar questions here on SO:

    Dependency injection with NHibernate objects

    DI/IoC, NHibernate and help in getting them to work together

    You'll need to use Interceptors. Take a look at Fabio Maulo's post for implementation:

    http://nhforge.org/blogs/nhibernate/archive/2008/12/12/entities-behavior-injection.aspx

提交回复
热议问题