zoukankan      html  css  js  c++  java
  • Entity Framework

    ADO.NET Entity Framework 是微软提供了一个ORM框架。

    概念架构定义语言:(CSDL:Conceptual Schema Definition Language)。

    存储架构定义语言:(SSDL:Storage Schema Definition Language)。

    映射架构语言:(MSL:Mapping Schema Language)。

    <?xml version="1.0" encoding="utf-8"?>
            <Schema Namespace="BooksModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2008" Alias="Self" xmlns="">   <EntityType Name="Authors">     <Key>       <PropertyRef Name="Id" />     </Key>     <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />     <Property Name="FirstName" Type="nvarchar" MaxLength="50" Nullable="false" />     <Property Name="LastName" Type="nvarchar" MaxLength="50" Nullable="false" />   </EntityType>   <EntityType Name="Books">     <Key>       <PropertyRef Name="Id" />     </Key>     <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />     <Property Name="Title" Type="nvarchar" MaxLength="50" Nullable="false" />     <Property Name="Publisher" Type="nvarchar" MaxLength="50" Nullable="false" />     <Property Name="Isbn" Type="nvarchar" MaxLength="50" Nullable="false" />   </EntityType>   <EntityType Name="BooksAuthors">     <Key>       <PropertyRef Name="Authors_Id" />       <PropertyRef Name="Books_Id" />     </Key>     <Property Name="Authors_Id" Type="int" Nullable="false" />     <Property Name="Books_Id" Type="int" Nullable="false" />   </EntityType>   <Association Name="FK_BooksAuthors_ToAuthors">     <End Role="Authors" Type="Self.Authors" Multiplicity="1" />     <End Role="BooksAuthors" Type="Self.BooksAuthors" Multiplicity="*" />     <ReferentialConstraint>       <Principal Role="Authors">         <PropertyRef Name="Id" />       </Principal>       <Dependent Role="BooksAuthors">         <PropertyRef Name="Authors_Id" />       </Dependent>     </ReferentialConstraint>   </Association>   <Association Name="FK_BooksAuthors_ToBooks">     <End Role="Books" Type="Self.Books" Multiplicity="1" />     <End Role="BooksAuthors" Type="Self.BooksAuthors" Multiplicity="*" />     <ReferentialConstraint>       <Principal Role="Books">         <PropertyRef Name="Id" />       </Principal>       <Dependent Role="BooksAuthors">         <PropertyRef Name="Books_Id" />       </Dependent>     </ReferentialConstraint>   </Association>   <EntityContainer Name="BooksModelStoreContainer">     <EntitySet Name="Authors" EntityType="Self.Authors" Schema="dbo" p3:Type="Tables" xmlns:p3="" />     <EntitySet Name="Books" EntityType="Self.Books" Schema="dbo" p3:Type="Tables" xmlns:p3="" />     <EntitySet Name="BooksAuthors" EntityType="Self.BooksAuthors" Schema="dbo" p3:Type="Tables" xmlns:p3="" />     <AssociationSet Name="FK_BooksAuthors_ToAuthors" Association="Self.FK_BooksAuthors_ToAuthors">       <End Role="Authors" EntitySet="Authors" />       <End Role="BooksAuthors" EntitySet="BooksAuthors" />     </AssociationSet>     <AssociationSet Name="FK_BooksAuthors_ToBooks" Association="Self.FK_BooksAuthors_ToBooks">       <End Role="Books" EntitySet="Books" />       <End Role="BooksAuthors" EntitySet="BooksAuthors" />     </AssociationSet>   </EntityContainer>
            </Schema>

    使用ADO.NET Entity Framework 需要定义的层:

    逻辑层:使用存储架构定义语言SSDL定义关系数据,用来描述数据表及表间关联关系的架构。

  • 相关阅读:
    2017年软件工程基础-个人项目作业
    [2017BUAA软工]第1次个人作业
    [2017BUAA软工]第0次个人作业
    个人作业——软件工程实践总结&个人技术博客
    个人作业——软件评测
    结对第二次作业
    软件工程结对作业
    寒假作业(2/2)
    软件工程寒假快乐作业
    技术总结——Vue页面刷新的方法
  • 原文地址:https://www.cnblogs.com/jiao1855/p/5147503.html
Copyright © 2011-2022 走看看