Create custom entity?

Posts   
 
    
edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 16-Oct-2008 21:22:32   

I would like to create a custom entity, but have it look like a normal entity. Is there a class I can inherit from that has most of the work done or do I have to figure out all the abstract methods in EntityBase2?

Thanks

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 16-Oct-2008 21:42:34   

All of the Entity classes inherit from CommonEntityBase. What are you trying to achieve with this ?

Matt

edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 16-Oct-2008 21:46:22   

MTrinder wrote:

All of the Entity classes inherit from CommonEntityBase. What are you trying to achieve with this ?

We have this Entity, AmendmentEntity that is part of a RegistrationEntity. However, when we set up DI for the validation, the AmendmentValidator is never called, whereas a "real" entity's validator is called. So I was thinking that because AmendmentEntity isn't "real" that LLBLGen wasn't calling it all so I want to make the entity more "real".

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 17-Oct-2008 11:38:27   

Please post the DependencyInjectionInfo attibute used for your Validator. Also post your class declaration code.

edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 17-Oct-2008 18:14:55   

Walaa wrote:

Please post the DependencyInjectionInfo attibute used for your Validator. Also post your class declaration code.


    /// <summary>
    /// Validator for the AmendmentEntity class
    /// </summary>
    [DependencyInjectionInfo(typeof(AmendmentEntity), "Validator")]
    [Serializable]
    public class AmendmentValidator : RegistrationValidatorBase

Where RegistrationValidationBase inherits from SD.LLBLGen.Pro.ORMSupportClasses.ValidatorBase.

edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 17-Oct-2008 19:51:11   

Sorry, attached on older version of AmendmentEntity. New version attached.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 18-Oct-2008 10:45:00   

Are you planning to use AmendmentEntity for persistence? (i.e. is it going to be mapped onto a table/view) ? If not, you could just create a class and not implement IEntity2: it's a bit unclear why you did implement that interface on this class.

To use the DI functionality, from the constructor, call: DependencyInjectionInfoProviderSingleton.PerformDependencyInjection(this);

so you pass the instance to inject stuff into to the method.

Frans Bouma | Lead developer LLBLGen Pro