0
I need to know how to map in the Fluent API the following item
public class ImportacaoHeader
{
public string IdImportacao { get; set; }
public DateTime dataInicio { get; set; }
}
public class ImportacaoLog
{
public string IdImportacao { get; set; }
public string CodigoCampo { get; set; }
}
The problem is the following, Idimportacao in the table Importacaoheader is key and Idimportacao tb is key in importacaoLog, Being that for each importacaoheader I have several occurrences in Importacaolog and the relationship between the two tables is the same key field in the two, first of all I warn you that I can not change the tables they already exist otherwise would have done and solved, how can I map this in the Fluent api, what the syntax would look like, and what I would have to change in the above classes?
If the field
IdImportacao
on the tableImportacaoLog
is key primary, it is impossible to have multiple occurrences for the sameImportacaoHeader
. Or she’s a Foreign Key (then it would have some other field being primary key), or it is a composite primary key, in which case the primary key could be composed by theIdImportacao
and byCodigoCampo
, that is, it could have several occurrences for the sameImportacaoHeader
, but only one for eachCodigoCampo
. Which of the two situations is yours?– Alisson