Well, I´m not quite sure, if this is possible at all, but maybe someone has a good solution for me.
I have a table in my DB that holds a few different "types" of records. All types have a few thinks in common, so I created a partial class "MyTable" that extends the auto generated "MyTable" class. But some methods differ. I want to have a function "Calculate" which is unique for every type. So I thought I could easily inherit from MyTable to achive that.
Well, that works, when using ActiveRecord, because it loads and saves itself.
But I use RepositoryRecord. To retrive a row from my db I use the command:
mytable foo = DB.Get<MyTable>(1)
But I cannot use this code:
mytableTypX foo = DB.Get<MyTable>(1)
or
mytableTypeX bar = DB.Get<MyTableTypeX>(1)
Both types dont work.
Another thing I tried is a class that implements IRecordBase
In the constructor I load a private MyTable-object and for every method or property to implement I pass the method to the object.
i.e.:
return _mytable.GetColumnValue(columnName)
The advantage of this it that I can control which columns of the underlying table are available in the class.
But I'm searching for a solution to use the DB.Get / DB.Save methods with the inherited , which doesn´t work, because MyTable cannot be converted to MyTableTypeX.
I hope that was clearly expressed, if not I could provide an example.