Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Accessing Data
ADO.NET
Feature Reference
Entity Data Model
 DefiningQuery Element (EntityContai...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
DefiningQuery Element (EntityContainer SSDL)

The DefiningQuery element in store schema definition language (SSDL) defines a query that maps to data-store views through client-side projection within the Entity Data Model (EDM). Such mappings are read-only. Without client-side projection, users map all store-view columns and provide a dummy update customization.

A narrow projection of system views is used to generate a default EDM. The defining query is read-only. Entity Data Model tools use mapping artifacts to start workflow. For more information, see How to: Add a Defining Query.

The following SSDL syntax shows the declaration of an EntitySet followed by the DefiningQuery element that contains a query used to retrieve the view.

<Schema> 
    <EntitySet Name="Tables" EntityType="Self.STable"> 
        <DefiningQuery> 
          SELECT  TABLE_CATALOG, 
                  'test' as TABLE_SCHEMA, 
                  TABLE_NAME 
          FROM    INFORMATION_SCHEMA.TABLES
        </DefiningQuery> 
    </EntitySet> 
</Schema>

The support for stored procedures in the ADO.NET Entity Framework can be used to enable read-write scenarios over arbitrary views that the user knows how to update. Either a store-view or an Entity SQL view can be used as the base table for retrieving data and for change processing by stored procedures.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker