This question is locked. New answers and comments are not allowed.
In converting our existing domain model over to the fluent mapping, we get the error, "Columns can only be shared between a simple and a
reference field. Usually, the reference field is the master and the
simple field is the slave."
We have a class that references itself multiple times.
i.e.
Product.SupercededBy {get;set}
Product.Parent {get;set}
Product.Supplements {get;set}
each returns a Product
mapping.HasAssociation(p => p.Supplements).HasConstraint((p, c) => p.SupplementsId == c.Id);
mapping.HasAssociation(p => p.SupercededBy).HasConstraint((p, c) => p.SupercededById == c.Id);
mapping.HasAssociation(p => p.Parent).HasConstraint((p, c) => p.ParentId == c.Id);
each has a unique foreign key in the database
This relationship worked just fine using the domain reverse-mapping tools... so, in theory, it should be reproducible using the only the Fluent API.
P.S. What is a simple field? and what is a reference field?
We have a class that references itself multiple times.
i.e.
Product.SupercededBy {get;set}
Product.Parent {get;set}
Product.Supplements {get;set}
each returns a Product
mapping.HasAssociation(p => p.Supplements).HasConstraint((p, c) => p.SupplementsId == c.Id);
mapping.HasAssociation(p => p.SupercededBy).HasConstraint((p, c) => p.SupercededById == c.Id);
mapping.HasAssociation(p => p.Parent).HasConstraint((p, c) => p.ParentId == c.Id);
each has a unique foreign key in the database
This relationship worked just fine using the domain reverse-mapping tools... so, in theory, it should be reproducible using the only the Fluent API.
P.S. What is a simple field? and what is a reference field?