Hi There
My apoligies if this is a stupid question!
I have 2 entities
order, country
order entity has 2 x relationships with country
delcountryid = country.ID
billCountryID = country.ID
I am implementing 2 class code generation.
I use
MyOrderEntity order = new MyOrderEntity(orderID);
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
PrefetchPath2 prefetch = new PrefetchPath2((int)EntityType.OrderEntity);
prefetch.Add(OrderEntity.PrefetchPathVwOrderSkuDetails);
prefetch.Add(OrderEntity.PrefetchPathDelCountry);
adapter.FetchEntity(order,prefetch);
}
When I access order.DelCountry.CountryName - I get the following error.
Unable to cast object of type 'MCart.EntityClasses.CountryEntity' to type 'MCart.EntityClasses.MyCountryEntity'.
What is the best way to implement this scenario. I want all the extra functionality in the MY.. classes.
Thanks heaps.
Marty