How to extend a Csla Class in the Application Main DLL ?

How to extend a Csla Class in the Application Main DLL ?

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


tarekahf posted on Wednesday, June 02, 2010

Suppose I want to add a new rule under "Namespace Csla.Validation", under class "CommonRules", but I do not want to modify the core Csla Code. How I can do this ?

I want to do this, so that I will unify all reference to new common business rules to be in one source, and make it easier to maintain.

What do you do to have the same result ?

I was thinking to use Partial Classes and the like, but it did not work.

Tarek.

RockfordLhotka replied on Wednesday, June 02, 2010

You can and should create your own library of common rules. Create your own class library project, add a static class to that project and put your rules in that class.

I would not recommend using the Csla.Validation namespace. You should use your own namespace based on your organization and maybe application name.

Copyright (c) Marimer LLC