Dynamic Enums from Reference Tables

Posts   
 
    
Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 25-Mar-2004 08:00:25   

What is the potential for, in addition to the current classes generated, a new type of class specifically enumerated values could be created as an additon to entity, typed lists ... dunamic enum

I am not sure it could be dynamic, allowing for update of reference tables and immediate availability with no dcdoing changes but that sure would be nice.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 25-Mar-2004 09:33:33   

I'm not sure if I understand your request exactly. Could you elaborate a bit or give a small example? simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Sink
User
Posts: 27
Joined: 23-Mar-2004
# Posted on: 25-Mar-2004 12:39:52   

Morning, Forget the dynamic part, not realistic. But how about the ability to generate enums for reference tables.

Table - AcctType smallint typeid; nvarchar(16) type;

Example In the gui design select the reference table and define/augment as enum and then within either base or derived class, add the enum

Requirement - smallint,int pk string value (no spaces)

    enum EAcctType
    {
             (first nvarchar) = 1,
              and so on
     }

I am sure there are other alternatives, but would be a nice feature

ctadlock avatar
ctadlock
User
Posts: 60
Joined: 12-Feb-2004
# Posted on: 21-Apr-2004 08:19:51   

I agree this feature would be nice to build in, we are implementing our own system just for this. For the table....

AccountType int AccountTypeID (PK) varchar Name varchar Description

That has the rows.

1 'Family' 'A family account.' 2 'Corporate' 'A corporate account.'

We dont generate an entity for the table but have the enum

public enum AccountType { [Description("A family account.'")] Family = 1,

[Description("A corporate account.'")]
Corporate = 2,

}

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 21-Apr-2004 09:08:49   

Isn't that very easy to setup in code? I mean, the code generated should be a data-generic solution, the data you put into the system is not part of the system.

That is... until inheritance in the designer is implemented, then the derived class has to be recognized and type values have to be defined in the designer as well.

Frans Bouma | Lead developer LLBLGen Pro