Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


DataAnnotations - Foreign Key


DataAnnotations - Foreign Key

Author
Message
luis.oliveira
luis.oliveira
Forum God
Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)

Group: Forum Members
Posts: 1, Visits: 4
I have two tables , which are called "Units " and "Products " . The primary key in the Units table called " UnidadeID ".

The Products table have two foreign keys , named " UnidadeDeCompra" and "UnidadeDeVenda" , both columns referencing the "Units" table.

In the project there are several other tables , of course , but with all the other is all right. My problem is only with the "Products" definition.



It happens that I need to create the code in the model "Entity Framework / Code First / Fluent API" using DataAnnotations in VB.Net language, but specifically for this pair of foreign keys, I have no idea how to do ... If it were a foreign key column only, or to several different tables, it would be no problem, but they are two to the same table using the cited mandatory and names that do not correspond to the field name in the referenced table... And I can not create via manager or EDMX should be through EF6, Code First.



Could anyone help me on this issue ?

Luis.Oliveira
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search