自定义CSLA服务器端初始化

时间:2010-07-19 09:06:52

标签: initialization settings csla

我有下一个问题。我们有一个庞大的客户端 - 服务器系统,并使用CSLA来操作数据库数据。有一组基于WinForms的客户端和一个基于WCF的AppServer。我们有自定义日志记录子系统,该子系统的设置存储在DB中。因此,在初始化系统的每一侧(客户端应用程序或应用程序服务器)时,我们需要使用来自DB的设置来配置日志记录子系统在客户端应用程序中,它很容易做到。但是,在初始化CSLA WCF Portal后,我们如何将CSLA WCF门户扩展到初始化日志?

那么,如何自定义CSLA的初始化?

非常感谢!!

1 个答案:

答案 0 :(得分:1)

Rockford Lhotka在论坛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.