I currently have a complex entity relationship setup based on my data structure in sql server 2008.
What I'm trying to do I would think would be ridiculously simple but I'm pulling my hair out and have spent days trying to figure it out.
I have an Address and AddressType table which are joined on addressTypeID. There are 2 AddressTypes, "Billing" and "Shipping". I'd like to be able to create a custom entity for both Billing and Shipping. I would have thought I could just inherit from the Address entity and add a condition to that to retrieve the correct type but its not as simple as that.
I do not want to remove the navigation properties or fields from these existing entities so that we can dive into those pre-existing entities if need be.
The goal is to create custom entities that contain fields from other entities based on certian criteria... almost like what a view does for SQL server. Literally all of the examples I found on the internet are not clear on how to do this.
What I have right now is Table per Concrete type (I believe). Everytime I try to do this vs yells at me telling me that things arent mapped etc... and I map them then get a new error message. Are there any good tuturials out there that are clear? I'd rather not dive into the ssdl, etc since those would get overwritten when I rebuild my model.
lazy loading is disabled... thats how I want it.
Why can't I just create a new entity, copy and paste the fields and set the table mapping? I created a new entity called BillingAddress, copied the fields from Address and set the table mapping.... then I get the error:
Error 297 Error 3033: Problem in mapping fragments starting at line 4525:EntitySets 'BillingAddresses' and 'Addresses' are both mapped to table 'Address'. Their primary keys may collide.
I also tried inheriting from the Address table.... error: must specify mapping fror all types in Set Addresses