私は2つのテーブルを持っていReports
ますVisualizations
. Reports
には、外部キーを介して同じ名前の のフィールドVisualizationID
を指すフィールド があります。Visualization
また、フィールドで宣言された一意のキーもあります。VisualizationID
null可能ではありません。つまり、関係は 0..1 対 1 でなければなりません。これは、すべて Reports
のレコードに null ではない一意のVisualizations
レコードが関連付けられている必要があるためです。
Entity Framework は、このように認識しません。次のエラーが表示されます。
Error 113: Multiplicity is not valid in Role 'Report' in relationship 'FK_Reports_Visualizations'. Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be *.
ここで何が問題なのですか?適切な関係の多重度を EF に認識させるにはどうすればよいですか?