Can't set properties on classes derived from an Entity

Posts   
 
    
younghov
User
Posts: 8
Joined: 14-Nov-2006
# Posted on: 24-Nov-2006 15:59:09   

Hi,

I have the following scenario. I've created a class that inherits from one of my GenPro generated entity classes. When i load the data from the database, i have to do a manual "downcast", something like this...

public MyNewClass(GenProEntity entity) : base(entity.EntityId) { LeftPos = seat.LeftPos; TopPos = seat.TopPos; Width = seat.Width; Height = seat.Height; }

All those properties are of type "double". Whats strange is that seat.LeftPos for example, correctly displays a valid value from the database. But the assignment statements simply don't work.

In other words, after LeftPos = seat.LeftPos, LeftPos will be equal to NaN (essentially a null value)

I've noticed while stepping through the code that the base class call to SetNewFieldValue(...) returns "FALSE"

I assume I'm doing something wrong but I can't figure it out just yet.

Any help would be appreciated.

younghov
User
Posts: 8
Joined: 14-Nov-2006
# Posted on: 24-Nov-2006 18:23:22   

Sorry Frans, this was a false alarm. I made a silly mistake by overriding the property's in question. Oops!

Thanks for a great tool.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 24-Nov-2006 19:27:33   

Thanks! simple_smile

Let's blame it on friday wink

Frans Bouma | Lead developer LLBLGen Pro