List all entities

Posts   
 
    
sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 01-Jun-2005 15:20:25   

Hi Frans, Is there a method that I can use to list all my entities and entity fields.

I am building a adhoc query frontend and would like to list all entries, and then when a entity is selected, I need to list all the selected entities fields.

Thanks in advance.

Posts: 112
Joined: 09-Aug-2004
# Posted on: 01-Jun-2005 17:35:10   

This is certainly possible with reflection.

http://www.google.com/search?hl=en&q=reflection+c%23

Take a look to see what reflection can do.

Posts: 112
Joined: 09-Aug-2004
# Posted on: 01-Jun-2005 17:41:19   

There is an easier way. There is an Enum called EntityType

BL.EntityType

Then there are also an Enum for each entity see this thread which is just a few posps below.

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3309

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 04-Jun-2005 14:59:14   

Great!

Thanks a lot.

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 08-Jun-2005 18:28:07   

Another query...if I may - flushed

currently I have coding as follows:

Dim objRelation As IEntityRelation = USERSEntity.Relations.USERROLEEntityUsingUSE_IDENTIFIER relationsToUse.Add(objRelation)

UsersFromUserRoleOrgsCol.GetMulti(SelectFilter, 0, sortOrder, relationsToUse)

Question: Is there anyway I can convert **USERSEntity.Relations.USERROLEEntityUsingUSE_IDENTIFIER **from a string to the LLBL Entityrelation objects before I pass it into **GetMulti **?

My intent is to pick up the relation as a string from a XML source and then use it to get data via selfservice method.

Thanks in advance.

Regards.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Jun-2005 12:20:21   

sparmar2000 wrote:

Another query...if I may - flushed

currently I have coding as follows:

Dim objRelation As IEntityRelation = USERSEntity.Relations.USERROLEEntityUsingUSE_IDENTIFIER relationsToUse.Add(objRelation)

UsersFromUserRoleOrgsCol.GetMulti(SelectFilter, 0, sortOrder, relationsToUse)

Question: Is there anyway I can convert **USERSEntity.Relations.USERROLEEntityUsingUSE_IDENTIFIER **from a string to the LLBL Entityrelation objects before I pass it into **GetMulti **?

My intent is to pick up the relation as a string from a XML source and then use it to get data via selfservice method.

Thanks in advance.

Regards.

Yes, you can create your own EntityRelation object. If you check out the code of the USERSEntity.Relations.USERROLEEntityUsingUSE_IDENTIFIER property, you'll see it creates an EntityRelation object. You can do that in code yourself and add that EntityRelation object to the RelationCollection passed to GetMulti()

Frans Bouma | Lead developer LLBLGen Pro
sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 13-Jun-2005 22:43:13   

Thanks Frans. wink

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 14-Jun-2005 20:03:39   

Hi I have another question.

The following works but....

        Dim en As Object = USERROLEFieldIndex.ROL_IDENTIFIER
        SelectFilter.Add(PredicateFactory.CompareRange(en, arrlngUsersToGet))

I would like a function that returns **USERROLEFieldIndex.ROL_IDENTIFIER ** so that I can 'add' to predicate. I would be gratefl if you can advise how the functions getIndex and getField would look like so that I can code as below:


dim EntFieldInx as string = "USERROLEFieldIndex"
dim EntityAttribute as string = "ROL_IDENTIFIER"

Dim en As Object = getIndex("USERROLEFieldIndex). getField("ROL_IDENTIFIER")

SelectFilter.Add(PredicateFactory.CompareRange(en, arrlngUsersToGet))