concept conceptual schema in category .net

appears as: Conceptual schema, conceptual schema, The conceptual schema
Entity Framework 4 in Action

This is an excerpt from Manning's book Entity Framework 4 in Action.

Inside the EntityContainer element of the conceptual schema, you put only one entity set for the entire hierarchy. Describing the classes requires the Abstract and BaseType attributes. For Company, Abstract is set to true and BaseType is empty. For Customer and Supplier, Abstract is set to false and BaseType is set to the FQN of Company. Their mapping is shown in the following listing.

Listing 5.19. Defining inheritance in the conceptual schema
<EntityContainer ...> <EntitySet Name="Companies" EntityType="OrderIT.Domain.Company" /> </EntityContainer> <EntityType Name="Company" Abstract="true"> <Key> <PropertyRef Name="CompanyId" /> </Key> <Property Type="Int32" Name="CompanyId" Nullable="false" store:StoreGeneratedPattern="Identity" /> <Property Type="String" Name="Name" Nullable="false" MaxLength="50" /> </EntityType> <EntityType Name="Customer" BaseType="OrderITModel.Company" > <Property Name="BillingAddress" Type="OrderITModel.AddressInfo" Nullable="false" /> <Property Name="ShippingAddress" Type="OrderITModel.AddressInfo" Nullable="false" /> <Property Type="String" Name="WSUsername" Nullable="true" MaxLength="20" /> <Property Type="String" Name="WSPassword" Nullable="true" /> <Property Type="String" Name="WSEnabled" Nullable="false" /> </EntityType> <EntityType Name="Supplier" BaseType="OrderITModel.Company" > <Property Type="String" Name="IBAN" Nullable="false" FixedLength="true" MaxLength="26" /> <Property Type="Int16" Name="PaymentDays" Nullable="false" /> </EntityType>

5.2.2. Describing entities in the conceptual schema

The conceptual schema contains the description of the entities. Creating this schema isn’t difficult at all, but because many XML tags are involved, you might find it confusing at first. Fortunately, these tags are reused in the storage schema, significantly simplifying the entire EDM.

In the EDMX file for OrderIT, the conceptual schema is at the path edmx:Edmx/edmx:Runtime/edmx:ConceptualModels. If you create the conceptual file manually, you can name it OrderIT.csdl and reference it in the database connection string. In the CSDL file, you must ignore the preceding XML path because it’s part of the EDMX artifact. This applies also to the storage and the mapping files.

Figure 10.11. The wizard imports into the conceptual schema a stored procedure that returns a single decimal value.