entity fields collection

Posts   
 
    
morten71
User
Posts: 80
Joined: 13-Jan-2009
# Posted on: 22-Jul-2011 01:46:14   

I need to build some logic that requires me to iterate over table columns to query name, datatype etc.

Can I do this by querying the entity? Something like:

for each column in UserEntity.Columns

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 22-Jul-2011 06:23:31   

From your previous posts I assume you are using SelfServicing. You can achieve that this way:

foreach (EntityField f in new UserEntity().Fields)
{
    string theColumnName = f.SourceColumnName);
    ...
}
David Elizondo | LLBLGen Support Team