简体   繁体   中英

Selecting Ids in entity framework?

How do I select all Ids in any entity query as a List?

Let say I have an entity with 2 properties

(int)Id

(any type)(property)

How do I select all Ids in query as a List?

Like this:

var IDs = from e in Entities
          select e.Id;

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