Customize the CSLA server side initialization
I have next problem. We have a huge client-server system and use CSLA to operate with DB data. There are a set of WinForms-based clients and one WCF-based AppServer. We have custom logging subsystem and settings for this subsystem are stored in DB. So on initialization of each side of our system (client application or application server) we need to co开发者_JAVA百科nfigure logging subsystem with settings from DB. In the client application it is easy to do. But how can we extend CSLA WCF Portal to init logging after init of CSLA WCF Portal??
So, how to customize the initialization of CSLA?
Thanks a lot!!
Rockford Lhotka answered this question on his forum http://forums.lhotka.net/forums/p/9224/43785.aspx#43785
In CSLA 3.8 and higher there's one hook that exists on the server before anything else occurs. It is designed to enable authorization on every single server call, but it can be used to perform server-side initialization as well.
You need to implement Csla.Server.IAuthorizeDataPortal and add a config entry so the data portal knows the assembly qualified type name of your class that implements the interface.
精彩评论