Enum or custom representation of data?

Posts   
 
    
mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 10-Feb-2006 00:28:28   

Hello,

How do you guys use Enums with properties generated by LLBLGen? What I like to do is turn one of my integer properties into an enum instead...

I'm currently inheriting the class and shadowing the property I like to change...

However doing so still leaves the base class around - which can be used inadvertently.

So whats the best way to handle this?

Any possiblity of getting LLBLGen to use enums for properties? Small request simple_smile

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 10-Feb-2006 02:51:17   

I have been using my BL to send the Enum and then when I would receive the enum back I would submit it to the DAL as an int. I've never thought of doing anything like this, but have you looked into using a type converter that would be able to do this for you?

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 10-Feb-2006 03:21:23   

I think I'm going to go the inheritence route because I would like to pass entire objects to the end user... I just read over the LLBLGen docs and it cleared up a lot of questions I had. Perhaps I should have read the docs more closely.

Tho in the CHM help file, it says in the FactoryClass to declare:

Public Overrides Function Create() As IEntity2

but I have to declare it as

Public Overloads Overrides Function Create() As IEntity2

Would adding the extra overload cause any problems?

Also what about all the other base classes - like the EntityFieldIndex classes, etc, do I need to inherit those too?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 10-Feb-2006 07:55:40   

You can use a type converter for that. Be sure to place hte enum types in an assembly which you won't rename and keep it in the TypeConverters folder of the llblgen pro designer.

Frans Bouma | Lead developer LLBLGen Pro