How can I make a constraint on Entity Framework to read a foreign key relation from table cars to vehicle (for example) as 0..1 -> 1 instead of * -> 1?
I have tables
create TABLE [dbo].[Vehicles](
[Id] [int] IDENTITY(1,1) NOT NULL primary key,
<rest of the columns>
)
create TABLE [dbo].[Cars](
[Id] [int] NOT NULL,
<rest of the columns>
)
and foreign key:
alter table [Cars] add foreign key(id) references [Vehicles](id)
when I create a model from the DB, it is created as * -> 1 an I cant change:

I know I manually change the association between the two entities but it doesn’t matter because it doesn’t change the constraint
I need to do that to set the baseType property of Cars to Vehicle to Implement a Inheritance.
Currently I’m getting this error:
Multiplicity is not valid in Role ‘BoatsTPT’ in relationship
‘FK__BoatsTPT__Id__117F9D94’. Because the Dependent Role refers to the
key properties, the upper bound of the multiplicity of the Dependent
Role must be 1.
You must first make
Idcolumn in yourCarstable a primary key otherwise it is not one-to-one relation.