I don't know even what to search for in the forum for this.
Has anyone done this before, or how is it possible to create an entity class like this, mapped to one table:
the Customer class
has a property HomeAddress
which is itself a class of type AddressEntity
The class AddressEntity has fields like AddressLine1, City, State, Zipcode etc...
The customer class also has a property WorkAddress
which is itself the type AddressEntity also.
Customer's unique ID is called CustomerID, let's say, but the underlying database is written where all these fields are columns on the Customer table
create table Customers (
CustomerID int not null identity(1,1),
HomeAddressLine1 varchar(50) null,
HomeAddressLine2 varchar(50) null,
... etc...
WorkAddressLine1 varchar(50) null,
etc...
)
I am starting out with the (unchangeable-for-now) database, and want to create a model that is nice.
I also have the added challenge, that the Customer table in SQL has hard-coded limit of 25 addresses let's say. So, really, I would want the Customer class to have a property called Addresses, which is a strong-typed collection of AddressEntity types, each would have an identifying unique description (i.e. 'Home', 'Work', 'Work2', etc...)
??
thanks,
Mike