I am trying to figure out the best way to implement a certain part of my model. Any input would be awesome!!
I have an entity named Customer which has CustomerLocations (1-*) which have SalesOrders (1-*) which have Invoices (1-*).
I want to allow them to have multiple addresses (Billing and Shipping) per customer and per location. I want to store those values in the sales orders and invoices, not a foreign key, what if they delete one of their addresses later down the road.
I have tried complex types, but then they can’t have multiple, can they?
And having an Address entity, customer –> address (1-*) is ok, but a bit clumsy. How would you have a collection of billing and shipping addresses.?
Any input would be great, my forehead hurts from banging it into my desk 🙂
You can certainly define a complex type, and then have two instances of that complex type in your entity.
=> define complex type ‘Address’ (in the designer: right-click, ‘Add’, ‘Complex Type’)
=> add two Complex properties to your entity, BillingAddress and ShippingAddress (in the designer: right-click on the entity, ‘Add’, ‘Complex Property’)