查詢資料Querying Data

Entity Framework Core 使用 Language Integrated Query (LINQ) 查詢來自資料庫的資料。Entity Framework Core uses Language Integrated Query (LINQ) to query data from the database. LINQ 可讓您使用 C# (或您選擇的 .NET 語言),根據衍生內容和實體類別來寫入強型別查詢。LINQ allows you to use C# (or your .NET language of choice) to write strongly typed queries based on your derived context and entity classes. LINQ 查詢的表示法會傳遞至資料庫提供者,以資料庫特定查詢語言 (例如 SQL 用於關聯式資料庫) 進行轉譯。A representation of the LINQ query is passed to the database provider, to be translated in database-specific query language (for example, SQL for a relational database). 如需查詢處理方式的詳細資訊,請參閱查詢運作方式For more detailed information on how a query is processed, see How Query Works.