adding fields to an entity

Posts   
 
    
yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 10-Dec-2007 19:00:27   

version 1.0.2005.1 final (self-servicing) VS2005 asp.net 2.0


Hiya, my entity has a foreign key relationship

tblBreeder breederId countryId

tblCountry countryId countryName

I create an instance of the entity.How can I add countryName as a field, so that I don't have to create a country entity to get the country name?

many thanks,

yogi

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 10-Dec-2007 20:00:23   

hi yogiberr if you only intend to use the entity for reading purposes you could add a custom field, there are plenty of threads regarding that issue. But I think you'll be better using typed o dynamic lists for that purpose. You could as well use a prefetch path if you want to maintain the full crud operations on your entities while improving the efficiency of your code.

yogiberr
User
Posts: 432
Joined: 29-Jun-2005
# Posted on: 10-Dec-2007 21:26:09   

hiya Goose,

Ta for the reply.I don't think I need a list because it will be a single entity. It can be read-only.

you could add a custom field, there are plenty of threads regarding that issue

I can't seem to find any, though it seems that a custome field would be the way to go.

many thanks,

yogi

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 11-Dec-2007 04:03:55   

Hi yogi, From this thread, you can use option B and C in your case: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=12021&StartAtMessage=0&#66749

David Elizondo | LLBLGen Support Team