Search code examples
c#.netactiverecordcastle-activerecord

Castle - ActiveRecord - Inheritage


I'm trying to avoid creating the same properties in all ActiveRecord classes, so I am coding this:

Have a base class where I have my common properties: Id, Version, LastUpdate, etc...

public class IdentityBase<T> : ActiveRecordValidationBase<T> where T : class

Then my "child" class would have his own properties and should inherit from my IdentityBase.

[ActiveRecord("Users")]
public class User : IdentityBase<User>

Now I create an object user:

User user = new User()

and I can call user.Save() but I can't call user.FindAll() and many others public methods....

How can I solve this?


Solution

  • I have ActiveRecord 2.0 , and all methods like Find , and FindAll - are static so try to use

    User.FindAll()

    insted of

    user.FindAll()