Entity behaving funny

Posts   
 
    
wayne avatar
wayne
User
Posts: 611
Joined: 07-Apr-2004
# Posted on: 12-Nov-2004 15:32:06   

Hi frans.

I have a class that wraps an entity (Country). Country contains all the Englisg names for all the countries. It has a FK relationship to Afrikaans Countries (Another table) - yeah pretty wierd database design.

My problem is with the code below. The set of the property below in not working. As soon as value is assigned to this.CountryEntity.Country_AfrikaansEntity.Country the value of this.CountryEntity.Country_AfrikaansEntity.Country becomes "" (Empty string) .

        public string CountryAfrikaansName
        {
            get { return this.CountryEntity.Country_AfrikaansEntity.Country; }
            set { this.CountryEntity.Country_AfrikaansEntity.Country = value; }
        }

This only happens when new countries are inserted and not when editing. Is it possible that the assignment for "CountryAfrikaansName" is not working because "this.CountryEntity" has not been saved yet?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 12-Nov-2004 16:23:48   

If you're using selfservicing, and the entities are not yet filled in, it indeed wants to retrieve the entities from the DB, which are then empty.

Frans Bouma | Lead developer LLBLGen Pro