Dynamic lists

Posts   
 
    
simon831
User
Posts: 152
Joined: 19-Jan-2006
# Posted on: 07-Dec-2006 16:53:04   

Following the documentation for Dynamic lists:

ResultsetFields fields = new ResultsetFields(1); fields.DefineField(EmployeeFields.FirstName, 0, "FirstNameManager", "Manager");

It seems strange to have column and table names as strings in my code so I can replace the "FirstNameManager" with: ManagerFields.FirstName.Name

Is there anyway I can get the table name dynamically?

DvK
User
Posts: 323
Joined: 22-Mar-2006
# Posted on: 07-Dec-2006 17:44:54   

Using the EntityType enum ? Or using custom properties on Entities

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 07-Dec-2006 18:20:10   

You don't need to specify the tablenames as these names are aliasses for the entities. Only alias an entity if you join an entity multiple times. So the documentation's example joins employee twice, so it has to alias the entities to be sure the right entities are referenced. In a dynamic list where an entity is just once in the list, you don't have to specify names, just stick with for example:

fields.DefineField(EmployeeFields.FirstName, 0);

See for more complex usage the HnD code base (this forum) at http://www.llblgen.com/hndsimple_smile

Frans Bouma | Lead developer LLBLGen Pro