Używam kodu Entity Framework 4.3 z Oracle. Dostaję następujący błąd:Mapowanie klucza obcego z niestandardową nazwą kolumny
System.InvalidOperationException : The ForeignKeyAttribute on property 'WidgetSequence' on type 'WidgetDistributor.WidgetEntity' is not valid. The foreign key name 'WIDGETSEQUENCE_ID' was not found on the dependent type 'WidgetDistributor.WidgetEntity'. The Name value should be a comma separated list of foreign key property names.
Moje istoty są tak:
[Table("WIDGETENTITIES")]
public class WidgetEntity {
[Column("WIDGETENTITY_ID")]
public int Id { get; set; }
[ForeignKey("WIDGETSEQUENCE_ID")]
public WidgetSequence Sequence { get; set; }
// and other properties that map correctly
}
[Table("WIDGETSEQUENCES")]
public class WidgetSequence {
[Column("WIDGETSEQUENCE_ID")]
public int Id { get; set; }
[Column("NUMBER")]
public int Number { get; set; }
}
Mój kod wydaje się prawidłowe. Co zrobiłem źle, tutaj?
Dzięki za odpowiedź. A co z tym problemem? Mógłbyś rzucić okiem na proszę? Z góry dzięki ... http://stackoverflow.com/questions/29333787/how-to-create-lookup-table-and-define-relationships –