简体   繁体   中英

Visual Studio 2012 - Linq2SQL - How to add List as attribute?

I have a basic problem: I have a class "Customer". A Customer has several Email-Adresses. I'd like to add Email as List. I don't see how to do this, there are only "simple" types available for choosing.

thank you very much.... Edit:

I'm using Linq2SQL and trying to set attribute to a complex type. I do not know how to do this as there are only simple types available on the graphical editor...

You don't add it to the object directly. Instead, you add the association with the database table that stores the email addresses. Right-click on the designer and choose to add a new association. Fill out the popup, and it'll create an arrow between them. That arrow represents your List<> .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM