Friday, December 8, 2017

Potential runtime violation of table MigrationHistory's keys (MigrationHistory.MigrationId): Columns (MigrationHistory.MigrationId) are mapped to EntitySet MigrationHistories's properties (MigrationHistories.MigrationId) on the conceptual side but they do not form the EntitySet's key properties (MigrationHistories.ContextKey, MigrationHistories.MigrationId).

Error a pair of Error 3002: drawback in mapping fragments beginning at line 2532:Potential runtime violation of table MigrationHistory's keys (MigrationHistory.MigrationId): Columns (MigrationHistory.MigrationId) ar mapped to EntitySet MigrationHistories's properties (MigrationHistories.MigrationId) on the abstract aspect however they are doing not type the EntitySet's key properties (MigrationHistories.ContextKey, MigrationHistories.MigrationId).


The reason was in strange update results of EF model update operation. table seeable (database) continues to be a key, however in model read it had been deleted(automatically) from set of keys. however not everyplace or one thingelse... therefore the resolution - Set Entity Key to False and Nullable to True not for brand new fields, except for table

<EntityType Name="MigrationHistory">
          <Key>
            <PropertyRef Name="MigrationId" /> Find MigrationHistory
     <PropertyRef Name="ContextKey" /> Add this keys
    </Key>
          <Property Name="MigrationId" Type="nvarchar" MaxLength="150" Nullable="false" />
          <Property Name="ContextKey" Type="nvarchar" MaxLength="300" Nullable="false" />
          <Property Name="Model" Type="varbinary(max)" Nullable="false" />
          <Property Name="ProductVersion" Type="nvarchar" MaxLength="32" Nullable="false" />
        </EntityType>