Dryadwoods
Dryadwoods

Reputation: 2929

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?

Upvotes: 1

Views: 163

Answers (1)

Krzysztof Kr&#243;l
Krzysztof Kr&#243;l

Reputation: 150

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

User.FindAll()

insted of

user.FindAll()

Upvotes: 1

Related Questions