I am using entity framework on mvc but I am having a problem with this method. All I am doing is a reflection method below and don't understand why I am getting a field mapping error.
I also get the following error on the fields mentioned here.
Error :-
Error 13 Error 3021: Problem in mapping fragments starting at line 205:Each of the following
columns in table FormBuilder_Form_Fields is mapped to multiple conceptual side properties:
FormBuilder_Form_Fields.ID is mapped to <FormFieldsForm.Form.ID, FormFieldsForm.FormFields.ID>
C:\NewDevelopment\CaseddimensionsCMS\CaseddimensionsCMS\CaseddimensionsCms.edmx 206 11 CaseddimensionsCMS
Error 14 Error 3021: Problem in mapping fragments starting at line 228:Each of the following columns in table FormBuilder_field_values is mapped to multiple conceptual side properties:
FormBuilder_field_values.ID is mapped to <FormFieldValues.FieldValues.ID, FormFieldValues.Form.ID>
I am not to sure what this means as quite new to entity framework.
I have included a screen shot of the edmx file in the layout designer:
This is a pastbin of my edmx file
http://pastebin.com/GeL6mZd4
As to long a code didnt want to be posting it here.
Having the same issue I found the solution here. In short, you should:
Fixing this duplicate mapping issue requires a referential constraint, which the designer will only support in the next release, so save the edmx file, close it, then right-click it in Solution Explorer, select “Open With…” and double click on “XML Editor”.
In the CSDL section, you will see the ProductProductImages association:
Update your associations like:
<Association Name="FormsFormsFields">
<End Type="TableSplittingModel.Forms" Role="Form" Multiplicity="1" />
<End Type="TableSplittingModel.FormFields" Role="FormFields" Multiplicity="1" />
</Association>
by adding a ReferentialConstraint
<Association Name="FormsFormFields">
<End Type="TableSplittingModel.Forms" Role="Forms" Multiplicity="1" />
<End Type="TableSplittingModel.FormFields" Role="FormFields" Multiplicity="1" />
<ReferentialConstraint>
<Principal Role="Forms"><PropertyRef Name="id"/></Principal>
<Dependent Role="FormFields"><PropertyRef Name="id"/></Dependent>
</ReferentialConstraint>
</Association>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With