I would like to know if it is possible to map a 1-many database relationship as an array of primitives on the parent object class. For example, say I have a database as follows:
TABLE: PERSON
ID - int
TABLE: PERSON_EMAIL_ADDRESSES
PERSON_ID - int
EMAIL_ADDRESS - string
For my Person class, I'd like to have the following:
public class Person
{
public int ID { get; set; }
public string[] EmailAddresses { get; set; }
}
The default Linq to SQL & Entity Framework behavior would be to give me a separate class for the PERSON_EMAIL_ADDRESSES table, and a collection of that type on the Person object...which is what I don't want.
Looks like this can be done with NHibernate as described here, but is there any way to do this with either EF or Linq to SQL?
Thanks in advance, Wayne