Article ID: 2127408 - View products that this article applies to.
This article describes an All-In-One Code Framework sample that is available for download. This code sample demonstrates how to use complex type, which is one of the new features of Entity Framework 4.0 (EF4). This code sample shows how to add complex type properties to entities, how to map complex type properties to table columns, and how to map a Function Import to a complex type.
Collapse this imageExpand this image
Download informationTo download this code sample, click the following link:
Technical overviewComplex types are non-scalar properties of entity types that enable scalar properties to be organized within entities. Like entities, complex types consist of scalar properties or other complex type properties. Because complex types do not have keys, complex type objects cannot be managed by the Entity Framework apart from the parent object.
When the Entity Framework tools generate objects that represent entity types, these objects inherit from EntityObject. Likewise, objects generated for complex types inherit from ComplexObject. Both of these classes inherit from the StructuralObject base class. The scalar properties of complex type objects can be accessed like other scalar properties.
This sample demonstrates how to add complex Type properties to entities, how to map complex type properties to table columns, and how to map a Function Import to a complex type.
Note For more information about how to create the sample application and how to deploy the sample application, see the Readme.txt file that is included in the download package.
LanguagesThis code sample contains the following programming languages:
Collapse this tableExpand this table
What is All-In-One Code Framework?All-In-One Code Framework shows most Microsoft development techniques by using code samples in different programming languages. Each example is carefully selected, composed, and documented to show one common code scenario. For more information about All-In-One Code Framework, visit the following Web site:
How to find more All-In-One Code Framework samplesTo find more All-In-One Code Framework samples, you can simply click the following link:
For more information, visit the following Web sites:
Complex Type Objects (Entity Framework)
How to: Add a Complex Type Property to an Entity (Entity Data Model Tools)
How to: Create and Modify Complex Types (Entity Data Model Tools)
How to: Map Complex Type Properties to Table Columns (Entity Data Model Tools)
How to: Map a Function Import to a Complex Type (Entity Data Model Tools)
(http://go.microsoft.com/fwlink/?LinkId=151500)for other considerations.
Article ID: 2127408 - Last Review: September 28, 2010 - Revision: 3.0
Contact us for more help