Search code examples
c#castle-activerecord

How can I extend a model from a different assembly?


How can I add a property to a model that was created in an other assembly. We have many applications ranging from desktop applications to web applications so I have class library with each model needed along with their relationships. I am very easily able to reference my class library and query what is needed. However, due to the fact that I am not modelling every field in each table (some tables have upwards of 30+ fields).

How can I extend the original model to give it more properties? Or should I simply model everything in the tables that I am using? My original thinking was that it would be nice if the developer could extend any model to his will to fit his project needs.


Solution

  • you may inherit your own class of a new assembly form base class of old assembly if you have a reference to the old one and that class is public.