How to get the name of the DB table for a given entity

Posts   
 
    
Posts: 12
Joined: 29-May-2007
# Posted on: 02-Aug-2007 15:44:16   

Hi!

I'm using .NET Framework 2.0, LLBLGen Pro v. 2.0, the adapter template group and SQL Server 2005.

Is there a way, using LLBLGen Pro, to find out in code (at runtime) the name of the database table associated with a certain entity?

(I've search in the help and in forums but I haven't found yet a way to do this)

Thanks, Tudor

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 02-Aug-2007 15:51:53   

IPersistenceInfoProvider info = PersistenceInfoProviderSingleton.GetInstance(); IFieldPersistenceInfo fieldInfo = info.GetFieldPersistenceInfo(entityToSave.LLBLGenProEntityName, field.Name); string tableName = fieldInfo.SourceObjectName;

Posts: 12
Joined: 29-May-2007
# Posted on: 02-Aug-2007 15:54:58   

Thanks!