Import of EDMX file results in "foreign key...not being enforced"
Posted: Mon 27 Jan 2014 21:16
I am trying to import an existing EDMX file in Entity Developer. It reports an error for two entity types. I have a base "StorageLocation" type. From that, there is a derived "RackStorage" type. From that, I have "RackGrid" and "RackDiamond" derived types.
I get the following errors, which I could not find described in the help. The edmx has no problems in VisualStudio 2012 or 2013, and the generated classes work just fine as they are currently being created from the edmx (inheritance chain is properly enforced). The errors, although they reference the RackStorage type, actually result in the error 'x' on the base class StorageLocation.
Can you tell me how to address these errors so that I can complete the conversion? If you need the edmx file to evaluate, I can provide it; just tell me where it goes.
1 Problem in mapping fragments starting at lines 877, 888:The foreign key 'Foreign key constraint 'FK_RackDiamond_inherits_RackStorage' from table StorageLocations_RackDiamond (Id) to table StorageLocations_RackStorage (Id):' is not being enforced in the model. An Association or inheritance relationship needs to be created to enforce this constraint.
D:\Tmp\WineDataModel.edml
2 Problem in mapping fragments starting at lines 877, 883:The foreign key 'Foreign key constraint 'FK_RackGrid_inherits_RackStorage' from table StorageLocations_RackGrid (Id) to table StorageLocations_RackStorage (Id):' is not being enforced in the model. An Association or inheritance relationship needs to be created to enforce this constraint.
D:\Tmp\WineDataModel.edml
I get the following errors, which I could not find described in the help. The edmx has no problems in VisualStudio 2012 or 2013, and the generated classes work just fine as they are currently being created from the edmx (inheritance chain is properly enforced). The errors, although they reference the RackStorage type, actually result in the error 'x' on the base class StorageLocation.
Can you tell me how to address these errors so that I can complete the conversion? If you need the edmx file to evaluate, I can provide it; just tell me where it goes.
1 Problem in mapping fragments starting at lines 877, 888:The foreign key 'Foreign key constraint 'FK_RackDiamond_inherits_RackStorage' from table StorageLocations_RackDiamond (Id) to table StorageLocations_RackStorage (Id):' is not being enforced in the model. An Association or inheritance relationship needs to be created to enforce this constraint.
D:\Tmp\WineDataModel.edml
2 Problem in mapping fragments starting at lines 877, 883:The foreign key 'Foreign key constraint 'FK_RackGrid_inherits_RackStorage' from table StorageLocations_RackGrid (Id) to table StorageLocations_RackStorage (Id):' is not being enforced in the model. An Association or inheritance relationship needs to be created to enforce this constraint.
D:\Tmp\WineDataModel.edml