Fields on relates fields question

Posts   
 
    
tolga
User
Posts: 25
Joined: 26-Feb-2006
# Posted on: 02-Mar-2006 21:39:00   

Hi,

I am using the dataadapter model.

given the following object model:

Aircraft - VehicleModel (m:1) VehicleModel - VehicleCategory(m:1)

I know I can create a field on related field for the Aircraft class to have a convenience property for VehicleModel.VehicleModelName.

I know that I can also create a field on related field for the VehicleModel class to have a convience property for VehicleCategory.VehicleCategoryName.

Ideally I'd love to be able to create a field on Aircraft that is VehicleModel.VehicleCategoryName (which in its self is a field on a related field) but the designer doesn't allow that.

So using the partial classes functionality I'd like to "append" code in to Aircraft that mimics the VehicleModelName getter but applies the same logic to VehicleCategoryName.

I know this is possible, but I have a question in regards to its possible repercussions: 1) Will Aircraft.VehicleCategoryName be serialized also? 2) Will Aircraft.VehicleCategoryName be available in databinding? 3) This should survive code regeneration (due to usage of partial class implementation) 4) Will this screw up the AircraftEntityFactory or any of the EntityCollection internal sync code?

Thanks

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 03-Mar-2006 04:46:33   

1) Not sure 2) It should show up fine as long as the prefetch paths have been defined to fetch the proper information. 3) If it is in a different file that is not generated then it should be fine. If it is in the generated partial class then you will need to put your code in a code region. 4) Not sure

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 03-Mar-2006 08:39:34   

tolga wrote:

I know this is possible, but I have a question in regards to its possible repercussions: 1) Will Aircraft.VehicleCategoryName be serialized also?

Only data gets serialized. What you'll be adding is a property which simply reads a value from a related entity, so the property by itself doesn't contain data, the data is elsewhere, and in the entity where it's located, there it's serialized. So the data is serialized, but not in aircraft.

3) This should survive code regeneration (due to usage of partial class implementation)

Yes

4) Will this screw up the AircraftEntityFactory or any of the EntityCollection internal sync code? Thanks

No.

Frans Bouma | Lead developer LLBLGen Pro