How to customize the CSLA server side initialization

How to customize the CSLA server side initialization

Old forum URL: forums.lhotka.net/forums/t/9224.aspx


w1z posted on Monday, July 19, 2010

Hi!

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 configure 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!!

RockfordLhotka replied on Monday, July 19, 2010

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.

Copyright (c) Marimer LLC