Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: EDMX XML Namespaces issue

$
0
0
Hi Pawel,
here it is
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
      <Schema xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" Namespace="MyTestModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
        <EntityContainer Name="MyTestModelStoreContainer">
          <EntitySet Name="Parent" Table="Parent" store:Name="Parent" Schema="dbo" store:Type="Tables" EntityType="MyTestModel.Store.Parent" />
          <EntitySet Name="Child" Table="Child" store:Name="Child" Schema="dbo" store:Type="Tables" EntityType="MyTestModel.Store.Child" />
          <AssociationSet Name="ChildParent" Association="MyTestModel.Store.ChildParent">
            <End Role="Parent" EntitySet="Parent" />
            <End Role="Child" EntitySet="Child" />
          </AssociationSet>
        </EntityContainer>
        <EntityType Name="Parent">
          <Key>
            <PropertyRef Name="Id" />
          </Key>
          <Property Name="Id" Type="int" Nullable="false" />
          <Property Name="Name" Type="nvarchar" Nullable="true" />
        </EntityType>
        <EntityType Name="Child">
          <Key>
            <PropertyRef Name="Id" />
          </Key>
          <Property Name="Id" Type="int" Nullable="false" />
          <Property Name="Name" Type="nvarchar" Nullable="true" />
          <Property Name="Parent_Id" Type="int" Nullable="false" />
        </EntityType>
        <Association Name="ChildParent">
          <End Multiplicity="1" Role="Parent" Type="MyTestModel.Store.Parent" />
          <End Multiplicity="*" Role="Child" Type="MyTestModel.Store.Child" />
          <ReferentialConstraint>
            <Principal Role="Parent">
              <PropertyRef Name="Id" />
            </Principal>
            <Dependent Role="Child">
              <PropertyRef Name="Parent_Id" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
      </Schema>
    </edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema xmlns:cg="http://schemas.microsoft.com/ado/2006/04/codegeneration" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" Namespace="MyTestModel" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
        <EntityContainer Name="MyTestModelEntities" annotation:LazyLoadingEnabled="false">
          <EntitySet Name="ParentSet" EntityType="MyTestModel.Parent" />
          <EntitySet Name="ChildSet" EntityType="MyTestModel.Child" />
          <AssociationSet Name="ChildParent" Association="MyTestModel.ChildParent">
            <End Role="Parent" EntitySet="ParentSet" />
            <End Role="Child" EntitySet="ChildSet" />
          </AssociationSet>
        </EntityContainer>
        <EntityType Name="Parent">
          <Key>
            <PropertyRef Name="Id" />
          </Key>
          <Property Name="Id" Type="Int32" Nullable="false" />
          <Property Name="Name" Type="String" Nullable="true" FixedLength="false" />
          <NavigationProperty Relationship="MyTestModel.ChildParent" FromRole="Parent" ToRole="Child" Name="Child" />
        </EntityType>
        <EntityType Name="Child">
          <Key>
            <PropertyRef Name="Id" />
          </Key>
          <Property Name="Id" Type="Int32" Nullable="false" />
          <Property Name="Name" Type="String" Nullable="true" FixedLength="false" />
          <Property Name="ParentId" Type="Int32" Nullable="false" />
          <NavigationProperty Relationship="MyTestModel.ChildParent" FromRole="Child" ToRole="Parent" Name="Parent" />
        </EntityType>
        <Association Name="ChildParent">
          <End Role="Parent" Type="MyTestModel.Parent" Multiplicity="1">
            <OnDelete Action="Cascade" />
          </End>
          <End Role="Child" Type="MyTestModel.Child" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Parent">
              <PropertyRef Name="Id" />
            </Principal>
            <Dependent Role="Child">
              <PropertyRef Name="ParentId" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
      </Schema>
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
      <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
        <EntityContainerMapping StorageEntityContainer="MyTestModelStoreContainer" CdmEntityContainer="MyTestModelEntities">
          <EntitySetMapping Name="ParentSet">
            <EntityTypeMapping TypeName="MyTestModel.Parent">
              <MappingFragment StoreEntitySet="Parent">
                <ScalarProperty Name="Id" ColumnName="Id" />
                <ScalarProperty Name="Name" ColumnName="Name" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="ChildSet">
            <EntityTypeMapping TypeName="MyTestModel.Child">
              <MappingFragment StoreEntitySet="Child">
                <ScalarProperty Name="Id" ColumnName="Id" />
                <ScalarProperty Name="Name" ColumnName="Name" />
                <ScalarProperty Name="ParentId" ColumnName="Parent_Id" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
        </EntityContainerMapping>
      </Mapping>
    </edmx:Mappings>
  </edmx:Runtime>
  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <edmx:Designer>
    <edmx:Connection>
      <DesignerInfoPropertySet xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
      </DesignerInfoPropertySet>
    </edmx:Connection>
    <edmx:Options>
      <DesignerInfoPropertySet xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
        <DesignerProperty Name="EnablePluralization" Value="false" />
        <DesignerProperty Name="ValidateOnBuild" Value="false" />
        <DesignerProperty Name="CodeGenerationStrategy" Value="None" />
      </DesignerInfoPropertySet>
    </edmx:Options>
    <!-- Diagram content (shape and connector positions) -->
    <edmx:Diagrams />
  </edmx:Designer>
</edmx:Edmx>
Maybe it's my mistake, just switched the target framework to 4.5 the designer gives no error, targeting framework 4 gives the 3 errors listed above

Error 1 Error 10027: The XML namespace for the conceptual model's Schema element is not supported on this project's target framework version. C:\Code\tmp\EDMX\ConsoleApplication1\ConsoleApplication1\Model1.edmx 47 7 ConsoleApplication1
Error 2 Error 10028: The XML namespace for the storage model's Schema element is not supported on this project's target framework version. C:\Code\tmp\EDMX\ConsoleApplication1\ConsoleApplication1\Model1.edmx 7 7 ConsoleApplication1
Error 3 Error 10029: The XML namespace for the Mapping element is not supported on this project's target framework version. C:\Code\tmp\EDMX\ConsoleApplication1\ConsoleApplication1\Model1.edmx 91 7 ConsoleApplication1

Thanks, Max

Viewing all articles
Browse latest Browse all 1793

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>