I have the following tables:
A
--
Id : int
SomeString : varchar(20)
B
--
Id : int
BString: nvarchar(10)
AId : int // FK to A
I have an entity A which is already mapped to the table A.
For the entity B, I'm trying to do a composite so that I have all the data from B, as well as the fields from A. The fields from A shouldn't be changable via B though, they're just there for the use case.
I'm trying to build my (fluent) mapping for B like so:
Table("B");
Join(
"A"
m =>
{
m.KeyColumn("AId");
m.Inverse();
m.Map(p => p.SomeString);
}
);
Map(p => p.BString);
The problem occurs when I try to export the schema; it says the table A already exists. Any ideas, or doesn't this work at all?
Thanks