none
Error 3032: Problem in mapping fragments. RRS feed

  • Question

  • I just refreshed my data model from the database after changing a view and some sprocs.  The view aggregates a number of tables in the database and has been working fine.  I added five columns, and updated the related matching sprocs that are used to update from the view.  The definition was compiling correctly before with no problems.

    After doing this, a different table now gives the 3032 error.  This table is not inherited, it maps directly to the database but links to a number of the same tables.  The only 'odd' thing about the table is that it has a different name from the data store, but this change was made several months ago.  I don't know if patches have been applied to Visual Studio 2010 that would screw up my model?  The error is even stranger because I can save the model, and the error will disappear,  and then come back when either I compile the DLL with the model, or at run-time.  And this error does not stop the compiler so my web site goes all the way through to debugging and then blows up trying to connect to the model.

    The fragment in question is as follows, with everything between the EntityTypeMapping highlighted as a problem:

              <EntitySetMapping Name="Alerts">
                <EntityTypeMapping TypeName="IsTypeOf(AxxonCore.Alert)">
                  <MappingFragment StoreEntitySet="EventContactList">
                    <ScalarProperty Name="Disabled" ColumnName="Disabled" />
                    <ScalarProperty Name="SnoozeUntil" ColumnName="SnoozeUntil" />
                    <ScalarProperty Name="EventContactListID" ColumnName="EventContactListID" />
                    <ScalarProperty Name="MessageTypeValue" ColumnName="MessageType" />
                  </MappingFragment>
                </EntityTypeMapping>
              </EntitySetMapping>
    

    The entity itself is:

            <EntityType Name="Alert">
              <Key>
                <PropertyRef Name="EventContactListID" />
              </Key>
              <Property Name="EventContactListID" Type="Int32" Nullable="false" a:SetterAccess="Private" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" />
              <Property Name="MessageTypeValue" Type="Byte" Nullable="false" a:GetterAccess="Public" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" a:SetterAccess="Public" />
              <NavigationProperty Name="Contact" Relationship="AxxonCore.FK_EventContactList_Contacts" FromRole="EventContactList" ToRole="Contacts" />
              <NavigationProperty Name="Trigger" Relationship="AxxonCore.FK_EventContactList_DevicePortTriggers" FromRole="EventContactList" ToRole="DevicePortTriggers" />
              <NavigationProperty Name="Port" Relationship="AxxonCore.FK_EventContactList_DevicePorts" FromRole="EventContact" ToRole="DevicePort" />
              <NavigationProperty Name="Device" Relationship="AxxonCore.FK_EventContactList_Devices" FromRole="EventContact" ToRole="Device" />
              <NavigationProperty Name="Client" Relationship="AxxonCore.FK_EventContactList_Clients" FromRole="Alert" ToRole="Client" />
              <Property Type="DateTime" Name="SnoozeUntil" />
              <Property Type="Boolean" Name="Disabled" Nullable="false" />
             </EntityType>
    

    Container entry:

              <EntitySet Name="EventContactList" EntityType="AxxonCore.Store.EventContactList" store:Type="Tables" Schema="dbo" />
    

    Entity Type from Store:

            <EntityType Name="EventContactList">
              <Key>
                <PropertyRef Name="EventContactListID" />
              </Key>
              <Property Name="EventContactListID" Type="int" Nullable="false" />
              <Property Name="ClientID" Type="int" />
              <Property Name="DeviceID" Type="int" Nullable="false" />
              <Property Name="DevicePortID" Type="int" />
              <Property Name="DevicePortTriggerID" Type="int" />
              <Property Name="ContactID" Type="int" Nullable="false" />
              <Property Name="MessageType" Type="tinyint" Nullable="false" />
              <Property Name="SnoozeUntil" Type="datetime" />
              <Property Name="Disabled" Type="bit" Nullable="false" />
            </EntityType>
    

    The other block of XML that it is complaining is related to this problem is:

              <AssociationSetMapping Name="FK_EventContactList_DevicePorts" TypeName="AxxonCore.FK_EventContactList_DevicePorts" StoreEntitySet="EventContactList">
                <EndProperty Name="EventContact">
                  <ScalarProperty Name="EventContactListID" ColumnName="EventContactListID" />
                </EndProperty>
                <EndProperty Name="DevicePort">
                  <ScalarProperty Name="DevicePortID" ColumnName="DevicePortID" />
                </EndProperty>
                <Condition ColumnName="DevicePortID" IsNull="false" />
              </AssociationSetMapping>

    I was just tweaking a few small parts of the system before putting this into production. Any help would be appreciated.

    Thanks, Neil

     
    Wednesday, October 16, 2013 11:18 PM

Answers

All replies