Model.edmx不会从数据库更新

时间:2019-06-25 12:39:34

标签: .net sql-server visual-studio entity-framework model-view-controller

我想从数据库中更新model.edmx,因为我已经更新了sql-server中的视图。

我已经从model.edmx中删除了视图,然后从数据库转到更新模型,并尝试再次添加该视图,但是它不会用更新的视图刷新...我做错了吗?< / p>

How I update the model from database

我转到文件的XML编辑器,并且在更新模型时显示:

<!--Errors Found During Generation:
warning 6013: The table/view 'CodeBoxxSchool_Dev.dbo.Graduated Students' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it.
        <EntityType Name="Graduated Students">
          <Property Name="ID" Type="int" />
          <Property Name="CohortId" Type="int" />
          <Property Name="GraduationStatus" Type="nvarchar" MaxLength="150" />
          <Property Name="Name" Type="nvarchar" MaxLength="100" />
          <Property Name="FirstName" Type="nvarchar" MaxLength="100" />
          <Property Name="LastName" Type="nvarchar" MaxLength="100" />
          <Property Name="ContractStatus" Type="nvarchar" MaxLength="50" />
          <Property Name="DepositStatus" Type="nvarchar" MaxLength="50" />
          <Property Name="PartnerId" Type="int" />
          <Property Name="Expr1" Type="nvarchar" MaxLength="250" />
        </EntityType>-->

0 个答案:

没有答案