Hello,
I required help on a scenario.
I have two classes
public class Product { public virtual string Id { get; set; } public virtual extproductinfo ExtProductInfo { get; set; } }
public class extproductinfo { public virtual string productid{ get; set; } public virtual Product Product { get; set; } }
Mapping file goes like this:-
<class name="Product"> <id name="Id" /> <one-to-one name="ExtProductInfo" class="iSTAR.Data.extproductinfo, iSTAR.Data" constrained="false" /> </class>
<class name="extproductinfo"> <id name="productid" /> <one-to-one name="Product" class="iSTAR.Data.Product, iSTAR.Data" constrained="true" property-ref="Id"/> <property name="flags" /> </class>
Both the tables have same column as Primary Key i.e ProductId in extProductInfo and Id in Product. I require one-to-one mapping between the two tables. The mapping works fine.
But now I require to remove Productid from "extproductinfo". Can I define Id attribute of "Extproductinfo" in <one-to-one > mapping. It doesn't seem possible to.
Please help.
|